News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Option to select the linker - auto detect mode

Started by oBFusCATed, September 30, 2019, 08:29:48 PM

Previous topic - Next topic

stahta01

#15
Quote from: manuelS on April 21, 2020, 04:58:34 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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

manuelS

Thanks once again, it was very helpful to me!

oBFusCATed

Quote from: stahta01 on April 21, 2020, 05:12:54 PM
Quote from: manuelS on April 21, 2020, 04:58:34 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!]