Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: mirai on November 26, 2021, 11:46:10 am

Title: C::B library name processing policy
Post by: mirai on November 26, 2021, 11:46:10 am
Hi,

Please remind me what is the policy in C::B for conversion of linked static and dynamic libraries from "<path>lib<name>.<ext>" formulation to "<link_switch><name>"?
When C::B decides to convert "libsomelib.a" to "-Lsomelib" while passing such options to a linker and when to pass directly as defined in project options?
Title: Re: C::B library name processing policy
Post by: AndrewCot on November 27, 2021, 12:42:23 am
You will need to lookup the linker documentation as C::B is an IDE and the linker does the linking not C::B.

The GNU linker docs are available at https://sourceware.org/binutils/docs/ld/  . The section you want is https://sourceware.org/binutils/docs/ld/Options.html . The two parameters you will be interested in are -l & -L .
Title: Re: C::B library name processing policy
Post by: mirai on November 27, 2021, 08:11:08 am
No, C::B is converting project settings to linker commands and the question is when and how does it convert provided library names.
Title: Re: C::B library name processing policy
Post by: Miguel Gimenez on November 27, 2021, 09:44:50 am
The processing of library filenames is made in CompilerCommandGenerator::SetupOutputFilenames() at compilercommandgenerator.cpp:648.

Variable PrefixPolicy is loaded with the value in Project -> Properties -> Build targets -> Auto-generate filename prefix.