Lekensteyn / qt5printers

GDB Pretty printers for Qt5
https://bugs.kde.org/show_bug.cgi?id=331044
133 stars 31 forks source link

Added necessary -fPIC flag #6

Closed vadi2 closed 3 years ago

vadi2 commented 5 years ago
vadi@gooseberry:~$ nano test.cpp
vadi@gooseberry:~$ g++ test.cpp $(pkg-config --cflags --libs Qt5Core) -g
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qiodevice.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/qtextstream.h:43,
                 from /usr/include/x86_64-linux-gnu/qt5/QtCore/QTextStream:1,
                 from test.cpp:1:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:1187:4: error: #error "You must build your code with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC (-fPIE is not enough)."
 #  error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\
    ^~~~~
vadi@gooseberry:~$ g++ test.cpp $(pkg-config --cflags --libs Qt5Core) -g -fPIC
vadi@gooseberry:~$ 

Thanks a lot for including an easy to test example! It really makes a difference.

vadi2 commented 3 years ago

Bump.