如何使用Qt解决"Position Independant code"错误
How to solve "Position Independant code" error with Qt
我正在尝试在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
我找到了解决问题的解决方案。
我只需要在mecagen/gui中的makefile的50行中添加-FPIC。
感谢您的帮助。
相关文章:
- "throw expression code" 1e7 >返回 d 是什么?投掷标准::overflow_error( "too big" ) : d;意味 着?
- Visual Studio Code - C++ Debugger 無法啟動
- Visual Studio Code "undefined reference to `WinMain@16'"
- VS Code "command":"make"与终端窗口中的命令行"make"不同
- 使用VS Code和CMake Tools运行自定义命令
- 修改 VS Code 中的默认C++代码段
- 如何配置Visual Studio Code以使用cygwin,cmake和gcc进行调试
- std::to_string - 'to_string' 不是 'std' 的成员 - Visual Studio Code 1.42.0
- VS Code C++:不准确的系统包括路径错误(wchar.h,boost/lambda/lambda.hpp)
- C++新手,想知道如何使用VS code 2019播放音频文件
- "Unable to start debugging. No process is associated with this object." - 在Visual Studio Code中使用GDB
- 如何在Visual Studio Code中重命名我的a.exe文件?
- C++ Visual Studio Code 的设置不起作用
- 以某种方式告诉编译器"Do not process line of code"
- 在VS Code中编译C / C ++时如何禁用自动创建EXE文件?
- 将Qt与Visual Studio Code(Windows)一起使用
- 可视化 使用 VS Code 查找C++应用程序中的内存泄漏
- 将Visual Studio Code路径设置为.clang_format文件
- C++ Code 在 for 循环期间不会累积变量中的总和,仅提供最终迭代值
- 如何使用Qt解决"Position Independant code"错误