SFML community forums

Help => General => Topic started by: Maurycyt on September 16, 2019, 11:37:12 pm

Title: Undefined reference to blahblahblah in CodeBlocks
Post by: Maurycyt on September 16, 2019, 11:37:12 pm
Split from topic: https://en.sfml-dev.org/forums/index.php?topic=17956.0

It gives me "cannot find -ljpeg" ad well as "cannot find -lglew"
What in the world have I done wrong?
Title: Re: Undefined reference to blahblahblah in CodeBlocks
Post by: G. on September 16, 2019, 11:42:14 pm
Read the tutorial (https://www.sfml-dev.org/tutorials/2.5/start-cb.php), glew and jpeg are no longer a dependency of SFML, don't link them.
Title: Re: Undefined reference to blahblahblah in CodeBlocks
Post by: Maurycyt on September 17, 2019, 05:49:47 pm
Thank you, however, now I am still getting the initial problem. (Undefined reference to _imp___(something)).
I am working in Code::Blocks 17.12, on Windows 10. I am linking 3 screenshots, to verify, that I've set everything up the way it should be.

I've got the appropriate folder path given in all three sections under Search Directories -> Compiler and Linker.

In Program FIles (x86)\CodeBlocks\MinGW\bin I've got both libgcc_s_dw2-1.dll as well as libgcc_s_sjlj-1.dll, so the version shouldn't be a problem. Just in case I'll share that I've installed the GCC 7.3.0 MinGW (DW2) - 32-bit version from the downloads page.
Title: Re: Undefined reference to blahblahblah in CodeBlocks
Post by: Maurycyt on September 17, 2019, 05:57:58 pm
Update: I had the "follow C++14 language standard" compiler option not ticked, so I ticked it, and now I'm getting other "undefined reference to", but this time the referenced in question are mostly _Unwind_Resume and __gxx_personality_v0
Title: Re: Undefined reference to blahblahblah in CodeBlocks
Post by: eXpl0it3r on September 17, 2019, 11:59:43 pm
I split the topic into it's dedicated thread. Generally better to start your own thread if it's not directly related to the previous topic, especially if the previous thread is already four years old. ;)

In Program FIles (x86)\CodeBlocks\MinGW\bin I've got both libgcc_s_dw2-1.dll as well as libgcc_s_sjlj-1.dll, so the version shouldn't be a problem. Just in case I'll share that I've installed the GCC 7.3.0 MinGW (DW2) - 32-bit version from the downloads page.
now I'm getting other "undefined reference to", but this time the referenced in question are mostly _Unwind_Resume and __gxx_personality_v0

There's a reason the big red box on the download page says:
Quote
The compiler versions have to match 100%!

Since you seem to be using the MinGW compile that came with Code::Blocks, you can't use the GCC 7.3.0 MinGW (DW2) SFML package, because they don't match.
Instead you can potentially use the GCC 5.1.0 TDM (SJLJ) - Code::Blocks - 32-bit package, but depending on your linker settings, you still might have to rebuild SFML with CMake and your compiler to get a 100% match.