初次在linux 使用vscode ,只想运行个helloword,却一直提示你没有Main。
g++编译也提示这个问题。
解决方案:
原来是vscode代码写完需要保存,不然那个文件都是空白。
在file 里面选择auto save或者手动save 就可以运行了
vscode (.text+0x20): undefined reference to `main‘ collect2: error: ld returned 1 exit status
最新推荐文章于 2025-05-13 12:14:38 发布