I am trying to create a C++ library with QT. However, when I launch the builder, QT Creator asks me to provide an executable. I do not understand what it is really asking for. Why would need an executable to make a library?
Thanks!!!
I am trying to create a C++ library with QT. However, when I launch the builder, QT Creator asks me to provide an executable. I do not understand what it is really asking for. Why would need an executable to make a library?
Thanks!!!
To make a static library NAME, just collect your objects into an archive with
$ ar ru libNAME.a *.o
To make a shared library, it's
$ g++ OPTIONS -shared -o libNAME.so -Wl,-soname,NAME *.o
When you are linking a shared library with g++, you also need to give it any link OPTIONS that you would need for your program if you were linking an executable. For example, extra libraries (-lm), optimisation (-O2), pthreads (-pthread) or whatever.