新微赢技术网
标题:
error LNK2001是什么原因?
[打印本页]
作者:
ご倾城↘恋
时间:
2009-11-4 01:02
标题:
error LNK2001是什么原因?
#include "iostream"
using std::cin;
using std::cout;
using std::endl;
#include "iomanip"
using std::setw;
#include "cstdlib"
int mian()
{
unsigned seed;
cout<<"Enter seed:";
cin>>seed;
srand(seed);
for(int counter=0;counter<10;counter++)
{
cout<<setw(10)<<(1+rand()%6);
if(counter%5==0)
cout<<endl;
}
return 0;
}
--------------------Configuration: 3_9 - Win32 Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/3_9.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
3_9.exe - 2 error(s), 0 warning(s)
作者:
我是医师
时间:
2009-11-4 01:02
#include <iostream>
//using std::cin;
//using std::cout;
//using std::endl;
#include <iomanip>
//using std::setw;
#include <cstdlib>
using namespace std;
int main()//这里是主要的不是你写的mian()
{
unsigned seed;
cout<<"Enter seed:";
cin>>seed;
srand(seed);
for(int counter=0;counter<10;counter++)
{
cout<<setw(10)<<(1+rand()%6);
if(counter%5==0)
cout<<endl;
}
cout<<endl;
system("pause");
return 0;
}
上面修改了一下你试一试如何(在C++Builder6.0运行通过)
欢迎光临 新微赢技术网 (http://bbs.weiying.cn/)
Powered by Discuz! X3.2