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

Author Topic: SOLVED Ubuntu + Code::Blocks + SFML = cannot find libraries?  (Read 8983 times)

0 Members and 1 Guest are viewing this topic.

virus

  • Newbie
  • *
  • Posts: 13
    • View Profile
SOLVED Ubuntu + Code::Blocks + SFML = cannot find libraries?
« on: October 16, 2010, 11:07:24 pm »
Hello,

I am running on Ubuntu 10.10, and I am getting this errors:

ld||cannot find -lsfml-graphics|
ld||cannot find -lsfml-window|
ld||cannot find -lsfml-system|
||=== Build finished: 3 errors, 0 warnings ===|


Do any of you know how to solve it?

Thanks!

nulloid

  • Full Member
  • ***
  • Posts: 134
    • View Profile
SOLVED Ubuntu + Code::Blocks + SFML = cannot find libraries?
« Reply #1 on: October 16, 2010, 11:14:53 pm »
Well, this wasn't too imformative. For example, what version of SFML do you use? Because That happened to me too, but because I use SFML2, I have to use -lsfml2-* linker options. That solved it.

virus

  • Newbie
  • *
  • Posts: 13
    • View Profile
SOLVED Ubuntu + Code::Blocks + SFML = cannot find libraries?
« Reply #2 on: October 16, 2010, 11:24:14 pm »
Standard... The actual version i believe 1.6...

I just downloaded it from the website (http://downloads.sourceforge.net/sfml/SFML-1.6-sdk-linux-64.tar.gz)...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SOLVED Ubuntu + Code::Blocks + SFML = cannot find libraries?
« Reply #3 on: October 16, 2010, 11:33:34 pm »
How did you install it?
Laurent Gomila - SFML developer

virus

  • Newbie
  • *
  • Posts: 13
    • View Profile
SOLVED Ubuntu + Code::Blocks + SFML = cannot find libraries?
« Reply #4 on: October 16, 2010, 11:34:51 pm »
I have unpacked it, and it is on my personal folder. On Code::Blocks i have followed the Code::Blocks tutorial on SFML webpage.

(Setting up stuff on Compiler & Debugger)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SOLVED Ubuntu + Code::Blocks + SFML = cannot find libraries?
« Reply #5 on: October 16, 2010, 11:44:04 pm »
Obviously, the libraries path was not properly configured. Can you show your linker configuration?
Laurent Gomila - SFML developer

virus

  • Newbie
  • *
  • Posts: 13
    • View Profile
SOLVED Ubuntu + Code::Blocks + SFML = cannot find libraries?
« Reply #6 on: October 16, 2010, 11:49:00 pm »
Linker Settings:

Other Linker Options:

-lsfml-graphics
-lsfml-window
-lsfml-system




I think would be great to do a tutorial not just for windows... I mean, there is "MinGW", and it is just for Windows cause MinGW is actually a simulation of gcc from linux :P

nulloid

  • Full Member
  • ***
  • Posts: 134
    • View Profile
SOLVED Ubuntu + Code::Blocks + SFML = cannot find libraries?
« Reply #7 on: October 17, 2010, 01:04:05 am »
Maybe you should specify the library's directory under Project -> Build options ->search directories? Just a wild guess... And not for just one build option, that is a common mistake I make nearly every time >.< :D

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
SOLVED Ubuntu + Code::Blocks + SFML = cannot find libraries?
« Reply #8 on: October 17, 2010, 03:15:52 am »
On Linux you should do system-wide installation anyway. This way you do not have to manually configure paths. Apart from that, sfml 1.6 is packaged for Ubuntu 10.10 so you should not have to do anything manually.

virus

  • Newbie
  • *
  • Posts: 13
    • View Profile
SOLVED Ubuntu + Code::Blocks + SFML = cannot find libraries?
« Reply #9 on: October 17, 2010, 03:51:12 am »
Thanks for the tip!
I installed it from Ubuntu Software Center and this problem was solved.

However, now I am getting errors in a lot of functions...

Code: [Select]
obj/Debug/audio.o||In function `carregar(char*)':|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|41|undefined reference to `sf::SoundBuffer::LoadFromFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'|
obj/Debug/audio.o||In function `tocar(int, float, float, bool)':|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|72|undefined reference to `sf::Sound::SetBuffer(sf::SoundBuffer const&)'|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|73|undefined reference to `sf::Sound::SetVolume(float)'|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|74|undefined reference to `sf::Sound::SetPitch(float)'|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|75|undefined reference to `sf::Sound::SetLoop(bool)'|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|76|undefined reference to `sf::Sound::Play()'|
obj/Debug/audio.o||In function `tocar(int)':|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|97|undefined reference to `sf::Sound::SetBuffer(sf::SoundBuffer const&)'|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|98|undefined reference to `sf::Sound::SetVolume(float)'|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|99|undefined reference to `sf::Sound::SetPitch(float)'|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|100|undefined reference to `sf::Sound::SetLoop(bool)'|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|101|undefined reference to `sf::Sound::Play()'|
obj/Debug/audio.o||In function `tocar_instancia(int)':|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|113|undefined reference to `sf::Sound::Play()'|
obj/Debug/audio.o||In function `tocar_instancias(int)':|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|127|undefined reference to `sf::Sound::Play()'|
obj/Debug/audio.o||In function `pausar(int)':|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|142|undefined reference to `sf::Sound::Pause()'|
obj/Debug/audio.o||In function `pausar_instancias(int)':|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|157|undefined reference to `sf::Sound::Pause()'|
obj/Debug/audio.o||In function `parar(int)':|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|172|undefined reference to `sf::Sound::Stop()'|
obj/Debug/audio.o||In function `parar_instancias(int)':|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|188|undefined reference to `sf::Sound::Stop()'|
obj/Debug/audio.o||In function `ajustar(int, float, float)':|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|205|undefined reference to `sf::Sound::SetVolume(float)'|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|208|undefined reference to `sf::Sound::SetPitch(float)'|
obj/Debug/audio.o||In function `ajustar_instancias(int, float, float)':|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|225|undefined reference to `sf::Sound::SetVolume(float)'|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|228|undefined reference to `sf::Sound::SetPitch(float)'|
obj/Debug/audio.o||In function `estado(int)':|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|254|undefined reference to `sf::Sound::GetStatus() const'|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|256|undefined reference to `sf::Sound::GetStatus() const'|
obj/Debug/audio.o||In function `atualizar()':|
/home/user/Desktop/Backup/Projects/Project1/audio.cpp|286|undefined reference to `sf::Sound::GetStatus() const'|
obj/Debug/audio.o||In function `audio_buffer':|
/home/user/Desktop/Backup/Projects/Project1/audio.hpp|4|undefined reference to `sf::SoundBuffer::SoundBuffer()'|
obj/Debug/audio.o||In function `audio_audio':|
/home/user/Desktop/Backup/Projects/Project1/audio.hpp|10|undefined reference to `sf::Sound::Sound()'|
||=== Build finished: 26 errors, 0 warnings ===|

virus

  • Newbie
  • *
  • Posts: 13
    • View Profile
SOLVED Ubuntu + Code::Blocks + SFML = cannot find libraries?
« Reply #10 on: October 17, 2010, 03:52:40 am »
Could someone post a how-to with SFML + Code::Blocks + Ubuntu?
It would be WAY HELPFUL not just for me...

Thanks again (:

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
SOLVED Ubuntu + Code::Blocks + SFML = cannot find libraries?
« Reply #11 on: October 17, 2010, 03:54:28 am »
You only need to also link against sfml-audio and that's your problem solved.

virus

  • Newbie
  • *
  • Posts: 13
    • View Profile
SOLVED Ubuntu + Code::Blocks + SFML = cannot find libraries?
« Reply #12 on: October 17, 2010, 04:28:48 am »
Ooohh!!! Everything working fine now!!

Thanks a LOT!!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SOLVED Ubuntu + Code::Blocks + SFML = cannot find libraries?
« Reply #13 on: October 17, 2010, 10:49:01 am »
Quote
Could someone post a how-to with SFML + Code::Blocks + Ubuntu?

You need to setup exactly the same options as with SFML + Code::Blocks + MinGW. The linker stuff is explained in the tutorial, with screenshots; you would probably have found alone if you had read it carefully ;)
Laurent Gomila - SFML developer