After creating a dynamic library on Linux I want to generate an import library (.a) from the dynamic library (.so). How can I do it?
actually, the dynamic library in linux did not need 'import library'. 'import library' is the idea in windows: when you build a dll, vs will also give you a lib file as the 'import library', or you have to build your own 'import library' through some 'ref' files.
*.a in linux is archive file, which is just, we say, zip the object file and make it as one object, not exactly, but, in some meaning you can understand it in that way. get a *.a and invoke it is easy.
*.a:
{compiler, gcc is a simple example} -g -c *.c
ar -{some flags, depends your compiler, -c is a simple example} liba.a *.o
{linker, gcc is a simple example} -g -o a -la -L.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With