gnu 和 gnu-arm 编译器可以在同一个系统上共存吗?
我先是在windows 10上成功运行MinGW32编译windows软件,后来越来越觉得GNU系列软件好用,那为什么连stm32都不用GNU-ARM编译呢?但是我无法在vscode上使用cmake成功编译stm32,
我遇到的第一个问题是系统变量,GNU和GNU-ARM都需要注册C、C++系统变量,下面是使用GNU-ARM 10编译stm32,但是工作过程给我显示的信息,vscode是还是叫GNU 5.3,(GNU我安装的是5.3版本,而我安装的GNU-ARM是比较新的)版本)
> Executing task: cmake -G 'MinGW Makefiles' L:\000_PROJECT\STM32\Project\vscode\dso138 <
-- The C compiler identification is GNU 5.3.0
-- The CXX compiler identification is GNU 5.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: E:/mingw32/bin/gcc.exe
-- Check for working C compiler: E:/mingw32/bin/gcc.exe - works
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: E:/mingw32/bin/c++.exe
-- Check for working CXX compiler: E:/mingw32/bin/c++.exe - works
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- MCU_FLAGS: -mcpu=cortex-m3 -mthumb
-- DBG_FLAGS: -g3 -gdwarf-2 -O0
-- Configuring done
-- Generating done
-- Build files have been written to: L:/000_PROJECT/STM32/Project/vscode/dso138/build
虽然它似乎工作正常,没有错误消息,也没有编译 bin 或 elf 文件。
第二个问题是关于vscode中任务列表的参数,
//task.json
task:[
{
...
{
/************************************************************************************
* cmake
***********************************************************************************/
"label": "cmake",
"command": "cmake",
"type": "shell",
"args": [
"-G",
"MinGW Makefiles",
"${workspaceFolder}"
],
"group": {
"kind": "build",
"isDefault": true
},
"options": {
"cwd": "${workspaceFolder}/build",
},
"dependsOn": [
"build_dir"
]
},
{
/************************************************************************************
* make
***********************************************************************************/
"label": "make",
"group": "build",
"type": "shell",
"command": "make",
"options": {
"cwd": "${workspaceFolder}/build",
"executable": "E:/gcc_arm/bin/arm-none-eabi-nm.exe"
},
"args": [
"-j"
],
"dependsOn": [
"cmake",
"del_exe"
]
}
...
}
我不确定,但问题可能是使用以下命令引起的:
cmake -G MinGW Makefiles
第三个问题是关于make的命令:
"E:/gcc_arm/bin/arm-none-eabi-nm.exe"
,
不确定上面的参数是否正确。
感谢您分享您的智慧和经验;