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

Author Topic: Compilation problem (undefined reference to sf::)  (Read 2534 times)

0 Members and 1 Guest are viewing this topic.

Nathaniell

  • Newbie
  • *
  • Posts: 1
    • View Profile
Compilation problem (undefined reference to sf::)
« on: April 25, 2015, 04:19:50 pm »
Hi

I'm working on team project in school and we are using sfml. So far I just wrote code outside the GUI section, but now I want to compile the whole thing and I'm getting standard undefined reference to sf:: error

I have Liinux Mint and I installed sfml via sudo apt-get install libsfml-dev and it didin't work so I tryed to download it from website and link it when compiling.. and I still get exactly same result.

For compilation I'm using this
Quote
g++ -Wall -pedantic -g -O0 -std=c++11 -I/home/debian/SFML-2.2/include -L/home/debian/SFML-2.2/lib -lsfml-graphics -lsfml-window -lsfml-system main.cpp ...and bunch of other .cpp files

Errors:
(click to show/hide)

So, what am I doing wrong? Do I need to download/install something else?
« Last Edit: April 25, 2015, 04:29:50 pm by Nathaniell »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10855
    • View Profile
    • development blog
    • Email
Re: Compilation problem (undefined reference to sf::)
« Reply #1 on: April 25, 2015, 05:45:31 pm »
List the source files first and then the -l flags.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Compilation problem (undefined reference to sf::)
« Reply #2 on: April 25, 2015, 07:05:15 pm »
What eXpl0it3r is telling you is that link order matters;)