遇到的问题 cc1: error: unrecognized command line option "-fconserve-stack"

本文介绍了解决交叉编译器不兼容的具体步骤,包括寻找合适的内核版本交叉编译器,并更新环境变量路径。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

      这个是交叉编译器不兼容的问题。


    解决办法:找到适合自己的内核版本的交叉编译器,然后放置到/usr/local/arm  目录下:

           然后再  /root/.bashrc  中保存修改的变量路径。


        export   PATH=$PATH:/usr/local/arm/....

byd@ubuntu:~/X1/ruckig/build$ cmake .. \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_INSTALL_PREFIX=../.. \ -DCMAKE_CXX_FLAGS="-m64 -fPIC" \ -DCMAKE_BUILD_TYPE=Release -- The CXX compiler identification is GNU 11.4.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - failed -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ - broken CMake Error at /usr/local/share/cmake-3.28/Modules/CMakeTestCXXCompiler.cmake:60 (message): The C++ compiler "/usr/bin/c++" is not able to compile a simple test program. It fails with the following output: Change Dir: '/home/byd/X1/ruckig/build/CMakeFiles/CMakeScratch/TryCompile-Cgnh4a' Run Build Command(s): /usr/local/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_14f1d/fast /usr/bin/gmake -f CMakeFiles/cmTC_14f1d.dir/build.make CMakeFiles/cmTC_14f1d.dir/build gmake[1]: Entering directory '/home/byd/X1/ruckig/build/CMakeFiles/CMakeScratch/TryCompile-Cgnh4a' Building CXX object CMakeFiles/cmTC_14f1d.dir/testCXXCompiler.cxx.o /usr/bin/c++ -m64 -fPIC -o CMakeFiles/cmTC_14f1d.dir/testCXXCompiler.cxx.o -c /home/byd/X1/ruckig/build/CMakeFiles/CMakeScratch/TryCompile-Cgnh4a/testCXXCompiler.cxx c++: error: unrecognized command-line option-m64’ gmake[1]: *** [CMakeFiles/cmTC_14f1d.dir/build.make:78: CMakeFiles/cmTC_14f1d.dir/testCXXCompiler.cxx.o] Error 1 gmake[1]: Leaving directory '/home/byd/X1/ruckig/build/CMakeFiles/CMakeScratch/TryCompile-Cgnh4a' gmake: *** [Makefile:127: cmTC_14f1d/fast] Error 2 CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:4 (project) -- Configuring incomplete, errors occurred! byd@ubuntu:~/X1/ruckig/build$
06-11
PS C:\Users\admin\下载\opentelemetry-java-examples-main\otlp> ../gradlew run Starting a Gradle Daemon (subsequent builds will be faster) FAILURE: Build failed with an exception. * What went wrong: Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used.For more details on the daemon, please refer to https://docs.gradle.org/8.14.2/userguide/gradle_daemon.html in the Gradle documentation. Process command line: cmd.exe /d /c start "Gradle build daemon" /b /belownormal /wait D:\Software\Java\jdk-1.8\bin\java.exe -XX:MaxMetaspaceSize=512m --add-exports j dk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser =ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED -Dfile.encoding=GBK -Dus er.country=CN -Duser.language=zh -Duser.variant -cp C:\Users\admin\.gradle\wrapper\dists\gradle-8.14.2-bin\2pb3mgt1p815evrl3weanttgr\gradle-8.14.2\lib\gradle-daemon- main-8.14.2.jar -javaagent:C:\Users\admin\.gradle\wrapper\dists\gradle-8.14.2-bin\2pb3mgt1p815evrl3weanttgr\gradle-8.14.2\lib\agents\gradle-instrumentation-agent-8.14.2.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.14.2 Please read the following process output to find out more: ----------------------- Unrecognized option: --add-exports Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org.
07-07
-- The C compiler identification is GNU 14.3.1 -- The CXX compiler identification is GNU 14.3.1 -- Checking whether C compiler has -isysroot -- Checking whether C compiler has -isysroot - yes -- Checking whether C compiler supports OSX deployment target flag -- Checking whether C compiler supports OSX deployment target flag - no -- Detecting C compiler ABI info -- Detecting C compiler ABI info - failed -- Check for working C compiler: /Applications/ArmGNUToolchain/14.3.rel1/arm-none-eabi/bin/arm-none-eabi-gcc -- Check for working C compiler: /Applications/ArmGNUToolchain/14.3.rel1/arm-none-eabi/bin/arm-none-eabi-gcc - broken CMake Error at /Applications/CLion.app/Contents/bin/cmake/mac/aarch64/share/cmake-4.0/Modules/CMakeTestCCompiler.cmake:67 (message): The C compiler "/Applications/ArmGNUToolchain/14.3.rel1/arm-none-eabi/bin/arm-none-eabi-gcc" is not able to compile a simple test program. It fails with the following output: Change Dir: '/private/var/folders/fk/_f55bj3j2b3g3gkmph9brvy40000gn/T/cmake_check_environment2/_build15339674733102076702/CMakeFiles/CMakeScratch/TryCompile-XV2Mjv' Run Build Command(s): /Applications/CLion.app/Contents/bin/ninja/mac/aarch64/ninja -v cmTC_f0cb2 [1/2] /Applications/ArmGNUToolchain/14.3.rel1/arm-none-eabi/bin/arm-none-eabi-gcc -arch arm64 -fdiagnostics-color=always -o CMakeFiles/cmTC_f0cb2.dir/testCCompiler.c.o -c /private/var/folders/fk/_f55bj3j2b3g3gkmph9brvy40000gn/T/cmake_check_environment2/_build15339674733102076702/CMakeFiles/CMakeScratch/TryCompile-XV2Mjv/testCCompiler.c FAILED: CMakeFiles/cmTC_f0cb2.dir/testCCompiler.c.o /Applications/ArmGNUToolchain/14.3.rel1/arm-none-eabi/bin/arm-none-eabi-gcc -arch arm64 -fdiagnostics-color=always -o CMakeFiles/cmTC_f0cb2.dir/testCCompiler.c.o -c /private/var/folders/fk/_f55bj3j2b3g3gkmph9brvy40000gn/T/cmake_check_environment2/_build15339674733102076702/CMakeFiles/CMakeScratch/TryCompile-XV2Mjv/testCCompiler.c arm-none-eabi-gcc: error: unrecognized command-line option '-arch'; did you mean '-march='? ninja: build stopped: subcommand failed. CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:2 (project) -- Configuring incomplete, errors occurred! 错误代码: 1
最新发布
08-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值