我是参考以下站点1进行的,但是当我使用以下过程构建它时,发生了错误。如果有人知道原因,请告诉我。
1vi .vscode/settings.json
2 我还会附上一张图片。2
{
"cmake.configureEnvironment": {
"PICO_SDK_PATH": "/home/$ubuntu/micro_ros_ws/src/pico-sdk",
},
}
3code .
错误代码
[{
"resource": "/home/ubuntu/micro_ros_ws/src/micro_ros_raspberrypi_pico_sdk/CMakeLists.txt",
"owner": "cmake-configure-diags",
"severity": 8,
"message": "CMake Error at CMakeLists.txt:3 (include):include could not find load file:\n\n /home/$ubuntu/micro_ros_ws/src/pico-sdk/external/pico_sdk_import.cmake",
"source": "CMake (include)",
"startLineNumber": 3,
"startColumn": 1,
"endLineNumber": 3,
"endColumn": 10000
}]
[{
"resource": "/usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake",
"owner": "cmake-configure-diags",
"severity": 8,
"message": "CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):The C compiler\n\n \"/bin/arm-none-eabi-gcc-9.2.1\"\n\nis not able to compile a simple test program.\n\nIt fails with the following output:\n\n Change Dir: /home/ubuntu/micro_ros_ws/src/micro_ros_raspberrypi_pico_sdk/build/CMakeFiles/CMakeTmp\n \n Run Build Command(s):/usr/bin/make cmTC_157be/fast && /usr/bin/make -f CMakeFiles/cmTC_157be.dir/build.make CMakeFiles/cmTC_157be.dir/build\n make[1]: Entering directory '/home/ubuntu/micro_ros_ws/src/micro_ros_raspberrypi_pico_sdk/build/CMakeFiles/CMakeTmp'\n Building C object CMakeFiles/cmTC_157be.dir/testCCompiler.c.o\n /bin/arm-none-eabi-gcc-9.2.1 -o CMakeFiles/cmTC_157be.dir/testCCompiler.c.o -c /home/ubuntu/micro_ros_ws/src/micro_ros_raspberrypi_pico_sdk/build/CMakeFiles/CMakeTmp/testCCompiler.c\n Linking C executable cmTC_157be\n /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_157be.dir/link.txt --verbose=1\n /bin/arm-none-eabi-gcc-9.2.1 CMakeFiles/cmTC_157be.dir/testCCompiler.c.o -o cmTC_157be \n /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): in function `exit':\n /build/newlib-CVVEyx/newlib-3.3.0/build/arm-none-eabi/newlib/libc/stdlib/../../../../../newlib/libc/stdlib/exit.c:64: undefined reference to `_exit'\n collect2: error: ld returned 1 exit status\n make[1]: *** [CMakeFiles/cmTC_157be.dir/build.make:87: cmTC_157be] Error 1\n make[1]: Leaving directory '/home/ubuntu/micro_ros_ws/src/micro_ros_raspberrypi_pico_sdk/build/CMakeFiles/CMakeTmp'\n make: *** [Makefile:121: cmTC_157be/fast] Error 2\n \n \n\n\n\nCMake will not be able to correctly generate this project.",
"source": "CMake (message)",
"startLineNumber": 60,
"startColumn": 1,
"endLineNumber": 60,
"endColumn": 10000,
"relatedInformation": [
{
"startLineNumber": 5,
"startColumn": 1,
"endLineNumber": 5,
"endColumn": 1000,
"message": "In call to 'project' here",
"resource": "/home/ubuntu/micro_ros_ws/src/micro_ros_raspberrypi_pico_sdk/CMakeLists.txt"
}
]
}]