Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Linker error because of stripping off lib prefix
sodev:
In a workspace i have two projects, one produces an executable, the other one a static library the executable gets linked with. The library project is simply called libs, it produces the output liblibs.a. The executable project references the output as libs in the linker settings.
The linking step however fails because on the actual command line this setting is turned into a -ls. For some reason the lib prefix gets stripped off. If i rename the library to something that does not start with lib like simplelibs, which results into the output libsimplelibs.a and the linker setting simplelibs, it does work.
This happens on Linux and Windows with the compiler GCC, if i switch to MSVC on Windows, which results into the output libs.lib and the linker setting libs, the linking does succeed.
oBFusCATed:
You'll have to manually pass the linker command using other linker options.
Or you'll have to inspect the code to see if the problem happens in the UI or somewhere deep in the compiler plugin.
If it happens in the UI it would probably be possible to fix this. If it is somewhere deep in the compiler plugin, it would probably be unfixable.
sodev:
--- Quote from: oBFusCATed on January 27, 2020, 07:27:28 pm ---You'll have to manually pass the linker command using other linker options.
--- End quote ---
Can't do that because i'm not hand writing the project files but generate them with my private Premake fork. I first thought that one is causing the error but it is not. I did inspect the .cbp file directly and there the library is correctly listed with the name libs.
I guess that rules out UI and falls into the unfixable case :-\
oBFusCATed:
What happens if you use liblibs in the cbp? And if you already have a fork you can modify it to make it do whatever you want :)
sodev:
Adding multiple lib prefixes only stripps off one of them.
Modifying the generator is quite some work i want to save, it is easier to change the output name in the script instead and push it into all projects. But that would violate the naming scheme :o, need to ask my OCD about it ;D.
Navigation
[0] Message Index
[#] Next page
Go to full version