SFML community forums

Help => General => Topic started by: Christ00pher on December 14, 2017, 09:45:07 pm

Title: File can be compiled through g++ in console, but not in codeblocks
Post by: Christ00pher on December 14, 2017, 09:45:07 pm
Hello, I have installed Codeblocks on my Debian Linux, I want to make a project with a bunch of files so using console g++ is pretty inconvenient.
I downloaded codeblocks and libsfml-dev through apt-get, however it doesn't seem to work properly.
After I try to compile sample code in codeblocks, I receive the message:
||=== Build: Debug in test_project (compiler: GNU GCC Compiler) ===|
ld||cannot find -lsfml-graphics-d|
ld||cannot find -lsfml-window-d|
ld||cannot find -lsfml-system-d|
||error: ld returned 1 exit status|
||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|


In build options, the only 2 things I changed were putting SFML_STATIC to #defines and inserting sfml-graphics/window/system-d modules for debug and sfml-graphics/window/system for release mode.
My guess would be that the compiler simply doesn't see sfml's libraries. How am I able to tell the compiler where to look?
And if that's not the case, how can I solve this issue?

PS: Here's how I compile the code through terminal:
$ g++ -c main.cpp
$ g++ main.o -o sfml-app -lsfml-graphics -lsfml-window -lsfml-system

I don't have to tell g++ any additional paths, so it seems that the sfml package was installed in default path, so shouldn't codeblocks compile it without any problem too?
Title: Re: File can be compiled through g++ in console, but not in codeblocks
Post by: eXpl0it3r on December 14, 2017, 09:50:47 pm
Ypu can't do something one way and thn do it differently the other way and expect it to work.

On Linux there are no debug libs provided by apt-get, thus the -d prefix is wrong.
Title: Re: File can be compiled through g++ in console, but not in codeblocks
Post by: Christ00pher on December 14, 2017, 10:11:36 pm
Oh... ok, deleted the suffix '-d' from debug mode and now everything works perfectly fine.
Thank you for your quick reply, appreciate it!