在Visual Studio Express 2013中为初学者设置c++
C++ Setup for beginners in Visual Studio Express 2013
我只是问一个乞丐程序员的一般问题:我如何设置/配置visual studio express 2013为乞丐?
我问,因为我在编译一个简单的'Hello World'程序时遇到了麻烦。
这是我的代码:
#include <iostream>
int main()
{
cout << "Hello World!" << endl;
return 0;
}
错误如下:
Error 1 error C2065: 'cout' : undeclared identifier c:usersblakedocumentsvisual studio 2013projectshello worldhello worldapp.xaml.cpp 6 1 Hello world
Error 2 error C2065: 'endl' : undeclared identifier c:usersblakedocumentsvisual studio 2013projectshello worldhello worldapp.xaml.cpp 6 1 Hello world
Warning 3 warning C4447: 'main' signature found without threading model. Consider using 'int main(Platform::Array<Platform::String^>^ args)'. c:usersblakedocumentsvisual studio 2013projectshello worldhello worldapp.xaml.cpp 8 1 Hello world
4 IntelliSense: identifier "cout" is undefined c:UsersBlakeDocumentsVisual Studio 2013ProjectsHello worldHello worldApp.xaml.cpp 6 2 Hello world
5 IntelliSense: identifier "endl" is undefined c:UsersBlakeDocumentsVisual Studio 2013ProjectsHello worldHello worldApp.xaml.cpp 6 28 Hello world
我已经关闭预编译头,但我仍然得到的问题。
我知道如果我把STD::放在前面,然后结束,我就可以避免两个错误。主要是因为我没有使用命名空间std. -我可以自己解决这个问题。
我还需要做什么吗?-我需要设置它纯粹为初学者,所以我可以编译和直接运行的东西!
在哪里运行编译后的文件?
- 文件->新建->项目。
- 在Visual c++项目类型窗格中,单击Win32,然后单击Win32控制台应用程序。
- 为项目键入一个名称,单击OK。
来源和链接到完整的指南:http://msdn.microsoft.com/en-us/library/ms235629.aspx
Visual Studio Express图片指南:http://cplusplus.com/doc/tutorial/introduction/visualstudio
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
当前,控制台窗口将在程序执行完成后立即退出。您可能希望在返回语句之前设置一个断点,以便查看程序的输出。
尝试在"include"行后面添加一行,并写入
using namespace std;
相关文章:
- 为不同配置设置MSVC_RUNTIME_LIBRARY的正确方法是什么
- 在C++/Linux中设置单调时钟的一些技巧
- 如何在选项卡视图Qt中设置一个新项目,并保存以前的项目
- 嵌套在类中时无法设置成员数据
- 需要帮助设置在C++中使用的Potrace
- 如何在自删除后将对象设置为nullptr
- C++错误消息*成员参考.**初学者*
- 将指针设置为"nullptr"并不能防止双重删除?
- 如何在Ubuntu中使用cmake设置qt4
- ld:bind_at_load和-bitcode_bundle(Xcode设置ENABLE_bitcode=YES)不能
- 如何在boost beast http请求中设置http头
- 如何解决gcc编译器优化导致的centos双编译器设置中的分段错误
- 如何将这个C++哈希表转换为动态扩展和收缩,而不是使用硬设置的最大值
- 为什么文件名被设置为一个点,而不是在读取矢量中的文件名时
- 如何在24位SDL_Surface上设置像素的颜色
- std::设置自定义比较器
- 如何设置一个范围来提取我想要获得的信息
- gluProject() 在 OpenGL VC++ 初学者中设置
- 设置Visual Studio for Windows初学者教程
- 在Visual Studio Express 2013中为初学者设置c++