[Linker error] undefined reference to `WinMain@16' 怎么办
#include<iostream>usingnamespacestd;intmian(){inta[2][3];intb[3][2],i,j;cout<<"A:"<<e...
#include <iostream>
using namespace std;
int mian()
{
int a[2][3];
int b[3][2],i,j;
cout <<"A:"<<endl;
for (i=0;i<=1;i++)
{
for (j=0;j<=2;j++)
{
cout <<a[i][j]<<" ";
b[j][i]=a[i][j];
}
cout <<endl;
}
cout <<"b:"<<endl;
for (i=0;i<=2;i++)
{ for (j=0;j<=1;j++)
cout <<b[i][j]<<endl;
}
return 0;
}
编译日志
编译器: Default compiler
执行 g++.exe...
g++.exe "D:\b.cpp" -o "D:\b.exe" -I"C:\Program Files\DEV-CPP\lib\gcc\mingw32\3.4.2\include" -I"C:\Program Files\DEV-CPP\include\c++\3.4.2\backward" -I"C:\Program Files\DEV-CPP\include\c++\3.4.2\mingw32" -I"C:\Program Files\DEV-CPP\include\c++\3.4.2" -I"C:\Program Files\DEV-CPP\include" -L"C:\Program Files\DEV-CPP\Lib"
C:\Program Files\DEV-CPP\Lib/libmingw32.a(main.o)(.text+0x106):main.c: undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
执行结束 展开
using namespace std;
int mian()
{
int a[2][3];
int b[3][2],i,j;
cout <<"A:"<<endl;
for (i=0;i<=1;i++)
{
for (j=0;j<=2;j++)
{
cout <<a[i][j]<<" ";
b[j][i]=a[i][j];
}
cout <<endl;
}
cout <<"b:"<<endl;
for (i=0;i<=2;i++)
{ for (j=0;j<=1;j++)
cout <<b[i][j]<<endl;
}
return 0;
}
编译日志
编译器: Default compiler
执行 g++.exe...
g++.exe "D:\b.cpp" -o "D:\b.exe" -I"C:\Program Files\DEV-CPP\lib\gcc\mingw32\3.4.2\include" -I"C:\Program Files\DEV-CPP\include\c++\3.4.2\backward" -I"C:\Program Files\DEV-CPP\include\c++\3.4.2\mingw32" -I"C:\Program Files\DEV-CPP\include\c++\3.4.2" -I"C:\Program Files\DEV-CPP\include" -L"C:\Program Files\DEV-CPP\Lib"
C:\Program Files\DEV-CPP\Lib/libmingw32.a(main.o)(.text+0x106):main.c: undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
执行结束 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询