Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: undefined reference to `sf::Texture : error : getNativeHandle() const'  (Read 2099 times)

0 Members and 2 Guests are viewing this topic.

InvisibleIncorporated

  • Newbie
  • *
  • Posts: 3
    • View Profile
Code: [Select]
void main(){
sf::CircleShape shape(200.f);
shape.getTexture()->getNativeHandle(); // uncommenting this function breaks the everloving fuck out of everything
shape.setFillColor(sf::Color::Red);
}

Hi everyone.

I'm here with SFML v2.4.2 and working on a RaspberryPi w/ its default fork of Debian as my distro. I seem to be entirely unable to finish a compile when getNativeHandle() is called. Any other code seems to be working fine.

Could someone please help me get to the bottom of what's causing this error? I'm starting to believe it might be something within SFML/OpenGL itself, but I'm not experienced enough of a developer to make that kind of claim confidently.

Thank you!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Run it through the debugger and find out where exactly it crashes and provide a call stack.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

InvisibleIncorporated

  • Newbie
  • *
  • Posts: 3
    • View Profile
Run it through the debugger and find out where exactly it crashes and provide a call stack.
It's a compile error, I can't really run it.

Here's the relevant portion of the build output-- but I don't think it says much.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Always include the error when you get one. It's not just random text, but explains exactly what is going on. Even if you may not get it, others probably will understand.

Sounds like you may have updated your header files, but when linking you're still using the older SFML libs where getNativeHandle() didn't exist.
Remove all the the traces of SFML on your system, especially when you installed the official SFML package before and then just re-install your own build of SFML.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

InvisibleIncorporated

  • Newbie
  • *
  • Posts: 3
    • View Profile
Always include the error when you get one. It's not just random text, but explains exactly what is going on. Even if you may not get it, others probably will understand.

Sounds like you may have updated your header files, but when linking you're still using the older SFML libs where getNativeHandle() didn't exist.
Remove all the the traces of SFML on your system, especially when you installed the official SFML package before and then just re-install your own build of SFML.
Upgraded all the libraries (libsfml-graphics2, libsfml-window2, libsfml-system2, libsfml-dev) to their newest versions, but didn't seem to get any noticeable difference in results. We only originally installed the SFML libraries about a month ago or so, so unless getNativeHandle is especially new (or the apt-get .so files are outdated)... do you know if the error could be caused by anything else?

(I think 'upgrade' is the equivalent of an uninstall/reinstall. Let me know if you want me to do that manually instead.)

 

anything