Lekensteyn / qt5printers

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

Compilation flags lack -fPIC on Linux #8

Open f35f22fan opened 4 years ago

f35f22fan commented 4 years ago

Hi, thanks for this very useful project!

On Linux (not sure about Windows or Mac): g++ test.cpp $(pkg-config --cflags --libs Qt5Core) -g should be g++ test.cpp $(pkg-config --cflags --libs Qt5Core) -fPIC -g

because otherwise the compiler complains:

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)."