下面的程序在complie时没错误,我build时有个错误,大家帮忙看下哪错了:
#include <iostream>
#include <cmath>
#include <cerrno>
int mian()
{
double f;
do
{
errno=0;
std::cout<<"enter positive float (0 to quit)";
std::cin>>f;
if(f!=0)
{
double sq=sqrt(f);
if(errno==0)
std::cout<<"square root of "<<f<<"is"<<sq<<std::endl;
else
std::cout<<"invalid entry"<<std::endl;
}
}
while(f!=0);
return 0;
}
--------------------Configuration: errnotest - Win32 Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/errnotest.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
errnotest.exe - 1 error(s), 0 warning(s)