tags:

views:

129

answers:

2

Dear All,

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!!!

+1  A: 

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.

alex tingle
+1  A: 

I guess it is trying to launch an executable (which is normal if you are developing an application).

Instead of hitting "Run" or Ctrl+R, try to use "Build" or Ctrl+B. This should prevent Qt Creator from trying to launch your project.

BastiBense