我有以下问题。我在调试我的程序。主文件显然是main.c。在编译时,我运行命令gcc -g -o main *.c ./rcv/*.c -lm -lpthread。main.c位于src目录中,而其他.c文件位于./rcv目录中。这是我的launch.json
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "C:\\Users\\r.dipascale\\Desktop\\vscode\\RTKLIB\\src\\main",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Abilita la riformattazione per gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Imposta Versione Disassembly su Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
}
]
}在VS代码中,当我打开main.c并单击Execute -> Start Debug时,我可以看到以下错误。在这里输入图像描述
发布于 2022-02-18 14:44:04
它说文件不是可执行格式,因为文件名必须以".exe“结尾。
文件名为"main“,它需要用于"main.exe”
这需要成为您的编译命令行:
gcc -g -o main.exe *.c ./rcv/*.c -lm -lpthreadhttps://stackoverflow.com/questions/71175181
复制相似问题