Author Topic: Option to select the linker - auto detect mode  (Read 15680 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Option to select the linker - auto detect mode
« Reply #15 on: April 21, 2020, 05:12:54 pm »
Hello Tim, thanks a lot. It's working this way! For my understanding just, "Other linker options" is not intended to ever add any compiler libs?

Correct. Those settings are added right before the libraries are added.

Edit: The only common exception is the shell scripts/commands are added at that location.
And, they often add libraries.

Tim S.
« Last Edit: April 21, 2020, 05:15:42 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline manuelS

  • Single posting newcomer
  • *
  • Posts: 5
Re: Option to select the linker - auto detect mode
« Reply #16 on: April 21, 2020, 05:27:42 pm »
Thanks once again, it was very helpful to me!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Option to select the linker - auto detect mode
« Reply #17 on: April 21, 2020, 07:45:01 pm »
Hello Tim, thanks a lot. It's working this way! For my understanding just, "Other linker options" is not intended to ever add any compiler libs?

Correct. Those settings are added right before the libraries are added.
Wrong. This field is intended for people which need to add special linker options. If this is some library so be it.
The problem here is that the order of libraries is important for ld or other unix linkers.
If libA depends on libB, libB should be before libA in the list. But the other linker options are appended to the linker command after the list of libraries, which violates the requirements of libA and you get a linking failure.

Ideally there should be a switch to disable this linker behaviour, but I've not yet implemented this.
(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!]