우분투 16.04, cmake 3.10.1, QT 5.6.2를 사용하고 있습니다.
Windows에서 응용 프로그램을 개발하는 데 익숙해 졌으므로 Linux 플랫폼에서 문제를 해결하는 방법을 잘 모릅니다. 나는 내 코드를 컴파일 할 때
-reduce-relocations로 QT를 빌드하는 방법
, 나는 오류
In file included from /usr/local/Qt/5.6.2/5.6/gcc_64/include/QtCore/qcoreapplication.h:37:0,
from /usr/local/Qt/5.6.2/5.6/gcc_64/include/QtWidgets/qapplication.h:37,
from /usr/local/Qt/5.6.2/5.6/gcc_64/include/QtWidgets/QApplication:1,
from /home/sulfred/Documents/SoftwareDev/github/SulfredLee/PcapReplayer/BackEnd/main.cpp:3:
/usr/local/Qt/5.6.2/5.6/gcc_64/include/QtCore/qglobal.h:1087: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. "\
^
Q1을 얻을.
내 Qt가 -reduce-relocations
으로 빌드되었는지 확인하는 방법.
이 질문이 있으십니까? https://stackoverflow.com/questions/24825093/how-to-remove-fpie-compiler-switch-from-qt-creator – MrEricSir
대단히 감사합니다.하지만 QMake를 사용하지는 않습니다. – sflee