1、ld returned 1 exit status
终于开始看《c++ primer plus》了,之前好不容易在vscode上配置好了c++的环境,结果书上的第一个代码就GG了。
代码如下:
#include <iostream>
int mian()
{
using namespace std;
cout << "try yi xia";
cout << endl;
cout <<"??????"<<endl;
cin.get();
return 0;
}
bug如下:
C:/software/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x2e): undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status
终端进程已终止,退出代码: 1
(原图如下)
哎呀妈呀,啊哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈hhhhhhhhhhhhhhhhhhh,hhhhhhhhhhhhhh哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈
main写成mian了,哈哈哈哈哈,被自己蠢哭了,啊哈哈哈哈哈哈,啊哈哈哈哈哈哈哈哈哈哈哈哈哈,我这样的凭什么写代码,啊哈哈哈哈哈哈
正经的,以后看到ld returned 1 exit status:
1、立马看看是不是这种低端的拼写错误
2、查的时候,网上还说可能是之前运行的窗口没有关闭
啊哈哈哈,我好菜啊
2
当时感到好奇的就是,为什么这玩意能对齐?因为我一直把它当作Tab键来理解的,那这两行Tab键之后,test2那里不应该错位一格嘛。
但是我太天真了,这玩意比我想象中的厉害多了:
意思是这玩意可以自动对齐!!!!!