Hi,
i need to create a static library from some code which also contains assembler code. The code won't compile with the compiler option -fPIC.
My pro file looks a follows:
TEMPLATE = lib
CONFIG += staticlib debug
QMAKE_CXXFLAGS_WARN_ON = -Wall -pedantic -ansi
...
TEMPLATE = lib
CONFIG += staticlib debug
QMAKE_CXXFLAGS_WARN_ON = -Wall -pedantic -ansi
...
To copy to clipboard, switch view to plain text mode
Now when compiling, the compiler option -fPIC is automatically added. There is a variable QMAKE_CXXFLAGS_SHLIB. If I let this empty, this would work, when I am building a shared library. Since I want to build a static library, setting this variable will not work.
Is there an equivalent variable for static libraries? Can't it be so hard to get rid of this fPIC option?
This is, what qmakes produces now:
g++ -c -g -fPIC -Wall -pedantic -ansi -I/usr/local/Trolltech/Qt-4.3.0/mkspecs/linux-g++-64 -I. -I. -I. -o cpucount.o cpucount.cpp
g++ -c -g -fPIC -Wall -pedantic -ansi -I/usr/local/Trolltech/Qt-4.3.0/mkspecs/linux-g++-64 -I. -I. -I. -o cpucount.o cpucount.cpp
To copy to clipboard, switch view to plain text mode
Thanks in advance,
Martin
Bookmarks