Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: cdavalillo on August 17, 2020, 01:26:20 am

Title: Lib file .a not generated in Fedora
Post by: cdavalillo on August 17, 2020, 01:26:20 am
Hi to everybody

I'm using C::B 20.03 in Fedora 32 64 bits. I'm trying to build a shared library as used to do in windows using C::B. The problem is that I don't see any output file .a after a right build. The .so file is in Debug file as always but after do a deep search there is no .a file in nowhere. So the question is I have miss something, I'm doing something wrong or it is a CodeBlocks error? How do I generate the .a file?

Thanks you in advance.
Title: Re: Lib file .a not generated in Fedora
Post by: oBFusCATed on August 17, 2020, 02:03:30 am
... So the question is I have miss something,...? How do I generate the .a file?
Yes, you miss how the linker/dynamic loaders work on linux. You have to read about it, if you want to do serious development on linux and not be bitten by strange problems.
As a start the linker doesn't need an import lib (*.lib on windows) to link to a dynamic library it can just use the info provided by the .so file.
*.a files are just archives of .o (object) files and they are meant for static libraries. Windows/Microsofts linker/tools reuse the .lib extension for two separate things and this cause lots of confusion unfortunately.
Title: Re: Lib file .a not generated in Fedora
Post by: cdavalillo on August 17, 2020, 04:40:05 am
 :o ohhhh thanks oBFusCATed so the problem was that I'm just a dummy user from Windows that just start to program in Linux and thinks the things works the same......

But you reply is helpfull thanks you very much....