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

> 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

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐