linux-arm编译报错m4: unrecognized option ‘--gnu‘

在Linux ARM平台上编译libuv时遇到m4报错,问题根源在于m4版本过旧不支持'--gnu'选项。更新m4到1.4.19版本后,./autogen.sh脚本执行成功,后续编译及安装过程无误。

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

linux-arm编译libuv第一步执行./autogen.sh报错,网上说的是autoconf和automake没有安装。

结论:m4版本比较老,不支持某些新的特性导致执行./autogen.sh报错,更新到1.4.19版本重新执行成功

m4: unrecognized option ‘–gnu’
Try `m4 --help’ for more information.
autom4te: m4 failed with exit status: 1
aclocal: error: echo failed with exit status: 1
autoreconf: aclocal failed with exit status: 1

我一开始查看了两个工具版本都是比较新的

automake (GNU automake) 1.14
Copyright © 2013 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later http://gnu.org/licenses/gpl-2.0.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Tom Tromey tromey@redhat.com
and Alexandre Duret-Lutz adl@gnu.org

07-18
"C:\stm32cubemx\Clion\CLion 2025.1.2\bin\cmake\win\x64\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=C:/stm32cubemx/tool/STM32CubeCLT_1.18.0/Ninja/bin/ninja.exe -DCMAKE_C_COMPILER=C:/stm32cubemx/tool/STM32CubeCLT_1.18.0/GNU-tools-for-STM32/bin/arm-none-eabi-gcc.exe -DCMAKE_CXX_COMPILER=C:/stm32cubemx/tool/STM32CubeCLT_1.18.0/GNU-tools-for-STM32/bin/arm-none-eabi-c++.exe -G Ninja -S C:\Users\Administrator\Desktop\bisai\led -B C:\Users\Administrator\Desktop\bisai\led\cmake-build-debug-stm32 -- The C compiler identification is GNU 13.3.1 -- The CXX compiler identification is GNU 13.3.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - failed -- Check for working C compiler: C:/stm32cubemx/tool/STM32CubeCLT_1.18.0/GNU-tools-for-STM32/bin/arm-none-eabi-gcc.exe -- Check for working C compiler: C:/stm32cubemx/tool/STM32CubeCLT_1.18.0/GNU-tools-for-STM32/bin/arm-none-eabi-gcc.exe - broken CMake Error at C:/stm32cubemx/Clion/CLion 2025.1.2/bin/cmake/win/x64/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake:67 (message): The C compiler "C:/stm32cubemx/tool/STM32CubeCLT_1.18.0/GNU-tools-for-STM32/bin/arm-none-eabi-gcc.exe" is not able to compile a simple test program. It fails with the following output: Change Dir: 'C:/Users/Administrator/Desktop/bisai/led/cmake-build-debug-stm32/CMakeFiles/CMakeScratch/TryCompile-poisww' Run Build Command(s): C:/stm32cubemx/tool/STM32CubeCLT_1.18.0/Ninja/bin/ninja.exe -v cmTC_2ffe4 [1/2] C:\stm32cubemx\tool\STM32CubeCLT_1.18.0\GNU-tools-for-STM32\bin\arm-none-eabi-gcc.exe -std=gnu11 -fdiagnostics-color=always -o CMakeFiles/cmTC_2ffe4.dir/testCCompiler.c.obj -c C:/Users/Administrator/Desktop/bisai/led/cmake-build-debug-stm32/CMakeFiles/CMakeScratch/TryCompile-poisww/testCCompiler.c [2/2] C:\WINDOWS\system32\cmd.exe /C "cd . && C:\stm32cubemx\tool\STM32CubeCLT_1.18.0\GNU-tools-for-STM32\bin\arm-none-eabi-gcc.exe CMakeFiles/cmTC_2ffe4.dir/testCCompiler.c.obj -o cmTC_2ffe4.exe -Wl,--out-implib,libcmTC_2ffe4.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ." FAILED: cmTC_2ffe4.exe C:\WINDOWS\system32\cmd.exe /C "cd . && C:\stm32cubemx\tool\STM32CubeCLT_1.18.0\GNU-tools-for-STM32\bin\arm-none-eabi-gcc.exe CMakeFiles/cmTC_2ffe4.dir/testCCompiler.c.obj -o cmTC_2ffe4.exe -Wl,--out-implib,libcmTC_2ffe4.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ." C:/stm32cubemx/tool/STM32CubeCLT_1.18.0/GNU-tools-for-STM32/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld.exe: unrecognized option '--major-image-version' C:/stm32cubemx/tool/STM32CubeCLT_1.18.0/GNU-tools-for-STM32/bin/../lib/gcc/arm-none-eabi/13.3.1/../../../../arm-none-eabi/bin/ld.exe: use the --help option for usage information collect2.exe: error: ld returned 1 exit status ninja: build stopped: subcommand failed. CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:28 (project) -- Configuring incomplete, errors occurred! [已完成]
07-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值