[Kde-hardware-devel] libnm-qt Qt5 port: -fPIC or fPIE needed?

Alex Richardson arichardson.kde at googlemail.com
Thu Oct 10 00:01:08 UTC 2013


Am Donnerstag, 10. Oktober 2013, 00:11:45 schrieb Sebastian Kügler:
> On Wednesday, October 09, 2013 18:14:10 Daniel Nicoletti wrote:
> > I have added this to some of my qt5 projects and it worked:
> > 
> > add_definitions(-fPIC)
> 
> Thanks Daniel, that helps. :)
> 
> > 2013/10/9 Sebastian Kügler <sebas at kde.org>:
> > > /home/sebas/kf5/qt5/qtbase/include/QtCore/../../src/corelib/global/qglob
> > > al
> > > .h:991:4: error: #error "You must build your code with position
> > > independent code if Qt was built with -reduce-relocations. " "Compile
> > > your code with -fPIC or -fPIE." make[2]: ***

I guess a better solution is:
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

This will probably also work with other compilers.


More information about the Kde-frameworks-devel mailing list