【发布时间】:2018-02-22 15:49:13
【问题描述】:
我正在尝试在 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命令。
请问我该怎么做才能解决这个问题?提前致谢!
编辑:请找到我要编译的代码https://github.com/juliendelile/MECAGEN
【问题讨论】:
-
请提供您尝试运行的代码
-
它显示了你是如何编译你的以及你用来做它的所有文件。
-
尝试在
isf/Makefile的第15行将-fPIC添加到CFLAGS变量中 -
感谢大家的帮助。 @Paul 我认为 isf 编译没有问题。不过,我确实在 CFLAGS 中添加了 -fPIC,但我遇到了同样的错误。
-
大家好。请问有人可以帮忙吗?