Visual C++ 2008 无法启动程序,系统找不到指定的文件
来源:互联网 发布:自定义 仅安装windows 编辑:程序博客网 时间:2024/05/29 12:42
用Visual C++ 2008 新建C++项目后,运行时报错,
代码如下:只是简单的打印helloworld
HelloWorld.cpp
#include <iostream>using namespace std;int main(){ cout << "Hello, world!" << endl; return 0;}
报错信息如下
1>------ 已启动生成: 项目: HelloWorld, 配置: Debug Win32 ------1>正在编译...1>helloworld.cpp1>正在编译资源清单...1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.11>Copyright (C) Microsoft Corporation. All rights reserved.1>正在链接...1>MSVCRTD.lib(crtexew.obj) : error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainCRTStartup 中被引用1>e:\Users\Visual Studio 2008\Projects\HelloWorld\Debug\HelloWorld.exe : fatal error LNK1120: 1 个无法解析的外部命令1>生成日志保存在“file://e:\Users\Visual Studio 2008\Projects\HelloWorld\HelloWorld\Debug\BuildLog.htm”1>HelloWorld - 2 个错误,0 个警告========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
截图信息
原因:新建项目类型时应该选择 控制台应用程序(对应的函数入口为main()方法),但是却错误的选择了Windows应用程序(对应的函数入口不是main()方法,而代码中却写的是main()方法),从而导致不能正常执行main()方法,报错找不到执行程序
二、调试成功后控制台一闪而过解决方案:
在代码中加入
system("pause");//或者 //char c;//c=getchar();
完整代码:
#include <iostream>using namespace std;int main(){ cout << "Hello, world!" << endl; system("pause"); return 0;}
参考:
http://blog.csdn.net/playstudy/article/details/6661868
http://blog.csdn.net/zhangzhengyuan123123/article/details/38876321
https://www.cnblogs.com/iczelion/p/6064120.html
阅读全文
0 0
- Visual C++ 2008 无法启动程序,系统找不到指定的文件
- 【BUG笔记】Visual Studio中“无法启动程序,系统找不到指定的文件”的解决办法
- visual web developer 2008 调试时:无法启动程序 “http://localhost/xxx不能调试”.系统找不到指定的文件.
- VS2005:无法启动程序,系统找不到指定的文件解决方法
- VS2008 无法启动程序 系统找不到指定的文件
- Bug:无法启动程序 系统找不到指定的文件
- VS2008 无法启动程序 系统找不到指定的文件
- vs2010 无法启动程序 系统找不到指定的文件
- VS2008 无法启动程序 系统找不到指定的文件
- vs2005 无法启动程序 系统找不到指定的文件---解决方案
- 无法启动程序 系统找不到指定的exe文件
- 无法启动程序 系统找不到指定的文件
- vs2010调试C++程序时提示 无法启动文件“....exe”系统找不到指定文件
- VS,无法启动指定的程序,系统找不到指定的文件
- VS,无法启动指定的程序,系统找不到指定的文件
- VS2005安装后,启动调试时,提示“无法启动程序 系统找不到指定文件”的解决方案
- vs执行程序时提示无法启动程序,系统找不到指定的文件
- VS无法启动程序,系统找不到指定的资源
- 数据可视化总结
- 从逻辑编程到机器学习模型编程
- 详细探究Python中的字典容器
- Dubbo项目配置文件解析
- 软考总结
- Visual C++ 2008 无法启动程序,系统找不到指定的文件
- Android的CheckBox控件的点击效果布局文件
- Hadoop 安装和配置
- Andrew Ng's deeplearning Course2Week1 Practice Questions(练习题)
- test
- VMware12安装Ubuntu16.04教程
- Redis Sentinel(主从切换配置)--windows
- PHP简洁之道
- 机器学习学习笔记1-简单的线性回归