c - 交叉编译探针 - rdynamic
问题描述
我一直在尝试将库 libsound 交叉编译到 wsl2 上的 Windows 10。
我使用了库的 github中描述的步骤。会议“为 Windows 构建”
但是,我在 cmake 执行过程中遇到了一些问题:
cmake .. -DCMAKE_TOOLCHAIN_FILE=/path/to/mxe/usr/x86_64-w64-mingw32.static/share/cmake/mxe-conf.cmake
命令返回:
-- The C compiler identification is GNU 5.5.0
-- Check for working C compiler: /home/andre/git/mxe/usr/x86_64-pc-linux-gnu/bin/x86_64-w64-
mingw32.static-gcc
-- Check for working C compiler: /home/andre/git/mxe/usr/x86_64-pc-linux-gnu/bin/x86_64-w64-
mingw32.static-gcc -- broken
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"/home/andre/git/mxe/usr/x86_64-pc-linux-gnu/bin/x86_64-w64-mingw32.static-gcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/andre/git/libsoundio/build-win64/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_8a923/fast && /usr/bin/make -f
CMakeFiles/cmTC_8a923.dir/build.make CMakeFiles/cmTC_8a923.dir/build
make[1]: Entering directory '/home/andre/git/libsoundio/build-win64/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_8a923.dir/testCCompiler.c.o
/home/andre/git/mxe/usr/x86_64-pc-linux-gnu/bin/x86_64-w64-mingw32.static-gcc -o
CMakeFiles/cmTC_8a923.dir/testCCompiler.c.o -c /home/andre/git/libsoundio/build-
win64/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_8a923
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8a923.dir/link.txt --verbose=1
/home/andre/git/mxe/usr/x86_64-pc-linux-gnu/bin/x86_64-w64-mingw32.static-gcc -rdynamic
CMakeFiles/cmTC_8a923.dir/testCCompiler.c.o -o cmTC_8a923
x86_64-w64-mingw32.static-gcc: error: unrecognized command line option '-rdynamic'
make[1]: *** [CMakeFiles/cmTC_8a923.dir/build.make:87: cmTC_8a923] Error 1
make[1]: Leaving directory '/home/andre/git/libsoundio/build-win64/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_8a923/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "/home/andre/git/libsoundio/build-win64/CMakeFiles/CMakeOutput.log".
See also "/home/andre/git/libsoundio/build-win64/CMakeFiles/CMakeError.log".
/home/andre/git/libsoundio/build-win64/CMakeFiles/没有登录。
我遵循了 github 中描述的所有说明。
有谁知道发生了什么?
解决方案
我假设使用与 MinGW 兼容的 GCC 构建的应用程序是与 Windows 兼容的应用程序,尽管我不确定。-rdynamic
仅与 Linux / ELF 目标相关。您可能需要确保指定了正确的编译器,例如通过设置 CC 环境变量。
推荐阅读
- django - 从数据库表中读取 Django urls.py、models.py、views.py 文件内容
- excel - Excel 宏:粘贴链接运行时错误 1004
- java - 确定 org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe with Spring Boot 1.5 和 Angular 5 的原因
- angular - Angular 2 - 从服务的一个 Firestore 文档返回字段
- php - 如何根据另一个表中的时间戳值从一个表中删除记录?
- php - 如何通过其他变量在路由中传递表单数据?
- php - 从 mongodb find() 结果中获取变量
- google-sheets - 从其他标签复制数据时使用 Google 表格或声明
- javascript - 为自定义值编辑移动仪表的代码
- openldap - 当我不知道任何用户或密码进行身份验证时,如何第一次使用 ldapmodify?