Code::Blocks Forums
User forums => Help => Topic started by: orefa on September 17, 2005, 03:28:30 am
-
Not sure if this is normal or not, but when I compile a static library named "foo" the resulting product is named "libfoo.a", that is a "lib" prefix is prepended to the name I gave it. I deleted the prefix from the target name in the project options but c::b insists on adding it. Maybe there's a reason for it that I'm not thinking of. Is this intentional or should I report it as a bug?
-
That must be intentional. Libraries in GCC start with lib and have the extension .a.
When you try to link a library (specifying -lname_of_the_library) it'll try to find libname_of_the_library.a
So, don't worry, it isn't a bug.
-
How curious, I reported this as a bug a week ago. Yiannis fixed it in CVS so that codeblocks isn't confused with library names anymore.
-
Yiannis fixed it in CVS
So it won't add "lib" to the library name anymore? That would be better. I just tried to link that "foo.a" in another project but the linker was not actually looking for "libfoo.a" so I had to rename it. A minor problem, but it's better solved than not. :)
-
Yiannis fixed it in CVS
So it won't add "lib" to the library name anymore? That would be better. I just tried to link that "foo.a" in another project but the linker was not actually looking for "libfoo.a" so I had to rename it. A minor problem, but it's better solved than not. :)
Yes, it's fixed.
-
The reason you prepend lib and postpend .a onto the specified file is so all compilers can use the same lib names and the lib tool adapts to the proper names. I should be able to specify the following standard libs without having to change them for each compiler I use.
shell32 (shell32.lib libshell32.a)
user32
shlwapi
C:\Program Files\CodeBlocks\lib\foo.a
If you use the full path for the lib, C::B does not add anything. There should be a less drastic way to get C::B to drop prefixes and suffixes. I end up with .o/.obj problems too. It seems that C::B stores a default lib/obj extension for each compiler but I can't find where to change it.
-
I end up with .o/.obj problems too. It seems that C::B stores a default lib/obj extension for each compiler but I can't find where to change it.
There's none actually, the prefix and extension are hardcoded into the compiler plugin. This will be subject to changes in the compiler revamp after v1.0 :wink:
-
It 's in Settings->Compiler->Other->Advanced options.