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

Author Topic: Undefined reference to blahblahblah in CodeBlocks  (Read 1344 times)

0 Members and 1 Guest are viewing this topic.

Maurycyt

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Undefined reference to blahblahblah in CodeBlocks
« 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?
« Last Edit: September 17, 2019, 11:55:09 pm by eXpl0it3r »

G.

  • Hero Member
  • *****
  • Posts: 1592
    • View Profile
Re: Undefined reference to blahblahblah in CodeBlocks
« Reply #1 on: September 16, 2019, 11:42:14 pm »
Read the tutorial, glew and jpeg are no longer a dependency of SFML, don't link them.

Maurycyt

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Undefined reference to blahblahblah in CodeBlocks
« Reply #2 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.

Maurycyt

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Undefined reference to blahblahblah in CodeBlocks
« Reply #3 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

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: Undefined reference to blahblahblah in CodeBlocks
« Reply #4 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/