Author Topic: "Link libraries" not strictly equivalent to "other linker options" ???  (Read 7937 times)

Offline monsieurouxx

  • Single posting newcomer
  • *
  • Posts: 4
Hi all,

I'm fairly new to code::blocks and I trip on an issue that's been baffling other beginners for a long time (I've found some thread as old as 2005 mentionning a similar issue, and even though workarounds have been given, the real cause of the issue has not been explained).

So, here I have that project that uses SDL.
I've set it up following that tutorial : http://www.noquarterarcade.com/setting-up-a-codeblocks-project-with-sdl-on-windows
....It works perfectly.

Now, when I delete "-lmingw32 -lSDL -lSDLmain etc." from "other linker options", and instead add the lines "mingw32", "SDL", "SDLmain", etc. to the "Link libraries" list, then the linker complains that many references are "undefined" within SDL.

Why is that? Aren't those 2 ways of entering link libraries supposed to be strictly equivalent?


Note: To fix this, I'd rather not do anything in "Settings-->Compiler"(I'd rather change things ONLY in my project), unless I haven't understood how it works and you explain to me that it's really necessary to mess with the global compiler settings as well as with the specific project settings.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: "Link libraries" not strictly equivalent to "other linker options" ???
« Reply #1 on: January 17, 2011, 07:33:18 pm »
Read this: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Setting project specific options in the global compiler options (Settings -> Compiler & Debugger -> Compiler) is not a good practice....
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline monsieurouxx

  • Single posting newcomer
  • *
  • Posts: 4
Re: "Link libraries" not strictly equivalent to "other linker options" ???
« Reply #2 on: January 18, 2011, 11:41:11 am »
Read this: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Thanks a lot, that helped for the visualization, and that's a very useful tip, but that wouldn't answer my theoritical question for every possible case.
I guess the answer is YES. Yes, those 2 fields are strictly equivalent. I just didn't enter the libraries in the exact same order (silly me!). Once in the correct order, both ways worked well.