Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何用Qt解决“位置独立码”错误_C++_Qt_Debian - Fatal编程技术网

C++ 如何用Qt解决“位置独立码”错误

C++ 如何用Qt解决“位置独立码”错误,c++,qt,debian,C++,Qt,Debian,我试图在debian上编译一些c++/Qt代码,但出现以下错误: /usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:1113: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

我试图在debian上编译一些c++/Qt代码,但出现以下错误:

/usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:1113: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. "\
代码有一个makefile,因此基本上只是执行make命令

请问我能做些什么来解决这个问题?提前谢谢


编辑:请查找我试图编译的代码

我找到了问题的解决方案

我只需要在mecagen/gui中的makefile的第50行添加-fPIC


感谢您的帮助。

请提供您正在尝试运行的代码,该代码显示了您如何编译自己的文件以及用于编译的所有文件。请尝试将-fPIC添加到isf/Makefile第15行的CFLAGS变量中。谢谢大家的帮助@我认为isf编译起来没有问题。尽管如此,我还是在CFLAGS中添加了-fPIC,我也有同样的错误。大家好。请问有人能帮忙吗?