发现没有删除编译好的文件时再次编译,会有这个报错:

> Executing task: /usr/bin/gcc '-Wall' -std=c99 '/home/testcode/sample/c/sort/.vscode/tasks.json' -o 'tasks' <

/usr/bin/ld:/home/testcode/sample/c/sort/.vscode/tasks.json: file format not recognized; treating as linker script
/usr/bin/ld:/home/testcode/sample/c/sort/.vscode/tasks.json:1: syntax error
collect2: error: ld returned 1 exit status
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

删除后好了:

> Executing task: /usr/bin/gcc '-Wall' -std=c99 '/home/testcode/sample/c/sort/main.c' -o 'main' <


Terminal will be reused by tasks, press any key to close it.

原因可能是我切换gcc,g++后需要删除
如果一直都是gcc就不会有问题。

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐