
无法解析的外部命令。fatal error LNK1120: 1 个无法解析的外部命令
//Ex2_01.cpp//ASimpleExampleofaprogram#include<iostream>usingstd::cout;usingstd::endl...
// Ex2_01.cpp
// A Simple Example of a program
#include <iostream>
using std::cout;
using std::endl;
int main()
{
int apples, oranges;
int fruit;
apples = 5; oranges = 6;
fruit = apples + oranges;
cout <<endl;
cout <<"oranges are not the only fruit..."<<endl
<<"- and we have" << fruit<<"fruits in all,";
cour <<endl;
return 0;
}
1>LINK : error LNK2001: 无法解析的外部符号 _mainCRTStartup
1>d:\我的文档\visual studio 2010\Projects\Ex2_01\Debug\Ex2_01.exe : fatal error LNK1120: 1 个无法解析的外部命令
1>
1>生成失败。
1>
哪里错了啊。。??
用的是win32控制台应用程序。 展开
// A Simple Example of a program
#include <iostream>
using std::cout;
using std::endl;
int main()
{
int apples, oranges;
int fruit;
apples = 5; oranges = 6;
fruit = apples + oranges;
cout <<endl;
cout <<"oranges are not the only fruit..."<<endl
<<"- and we have" << fruit<<"fruits in all,";
cour <<endl;
return 0;
}
1>LINK : error LNK2001: 无法解析的外部符号 _mainCRTStartup
1>d:\我的文档\visual studio 2010\Projects\Ex2_01\Debug\Ex2_01.exe : fatal error LNK1120: 1 个无法解析的外部命令
1>
1>生成失败。
1>
哪里错了啊。。??
用的是win32控制台应用程序。 展开
2个回答
展开全部
cour <<endl; -- cout 打错了一个字母。是 t 不是 r.
头部用:
#include <iostream>
using namespace std;
不要用:
using std::cout;
using std::endl;
头部用:
#include <iostream>
using namespace std;
不要用:
using std::cout;
using std::endl;
更多追问追答
追问
嗯改了还是这样。什么情况??谢谢
1>LINK : error LNK2001: 无法解析的外部符号 _mainCRTStartup
1>d:\我的文档\visual studio 2010\Projects\Ex2_01\Debug\Ex2_01.exe : fatal error LNK1120: 1 个无法解析的外部命令
1>
1>生成失败。
追答
源程序扩展名用 .cpp 了吗?
完整程序:
#include
using namespace std;
int main()
{
int apples, oranges;
int fruit;
apples = 5; oranges = 6;
fruit = apples + oranges;
cout <<endl;
cout <<"oranges are not the only fruit..."<<endl
<<"- and we have" << fruit<<"fruits in all,";
cout <<endl; // t
return 0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询