cmake - 如何在 cmake 中包含 -fPIC?
问题描述
我收到了这个错误
/usr/bin/ld: ../core/CMakeFiles/core.dir/logger.cpp.o: relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
我试过了
set_target_properties(emsim PROPERTIES POSITION_INDEPENDENT_CODE ON)
但这不起作用,我正在尝试链接pybind11,我应该如何处理这个错误?
谢谢!
解决方案
推荐阅读
- sql - 是否可以有条件地在 Oracle 中对不同数据类型的列进行透视?
- java - 正则表达式删除java中的特殊字符
- java - 如何通过 postgresql 查询在字符串列表中搜索枚举?
- ruby-on-rails - 如何在设计中为开发和生产设置不同的密码长度
- node.js - NodeJS 正常运行时间和时代
- python-3.x - Colab 中的 Python 脚本不断抛出错误消息:IndentationError: unindent does not match any external indentation level
- mysql - 在 MySQL 中导出每周唯一用户和每日唯一用户的新列
- r - R导入半非结构化数据CSV
- python - 运行与 main 分离的异步函数
- ruby - 使用哈希作为实例变量