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

Author Topic: Undefined reference to "sf::CircleShape::CircleShape(float, unsigned int)"  (Read 1932 times)

0 Members and 1 Guest are viewing this topic.

Zirk

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Hi,

I'm using the SFML 2.2.0 on Ubuntu 16.10.
I'm compiling with a Makefile with the following SFML flags :
LDLIBS  = -lsfml-graphics -lsfml-window -lsfml-system -lGL

But when I'm compiling, I have the following error:
Undefined reference to "sf::CircleShape::CircleShape(float, unsigned int)"

I checked CircleShape.hpp and the prototype exist.
CircleShape.hpp
41:class SFML_GRAPHICS_API CircleShape : public Shape
52:    explicit CircleShape(float radius = 0, unsigned int pointCount = 30);

I know that my program is suppose to work, because I didn't have any problem some times ago, but since I reinstall Ubuntu and the SFML I have this problem....

Thanks in advance !

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Sounds like a linking error.

Common cause of seems to be mixing SFML versions (or release/debug and 32-bit/64-bit) within the linking.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Or using old/different header files.

Make sure that there's really just one version of SFML around.
If you previously have installed SFML via package manager and now built your own version, make sure to remove the version installed by the package manager first.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Zirk

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
That was indeed the problem, I deleted every files related to the SFML in /usr/ and I reinstalled it and it's working now. Thanks a lot :)

 

anything