Visul studio 2012 doent创建.exe文件 [英] Visul studio 2012 doent create .exe file

查看:74
本文介绍了Visul studio 2012 doent创建.exe文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个简单的代码:


#include< iostream>


int main()


{cout<<" hi";


}


构建并编译它但会弹出一个错误:" ;无法运行程序" .exe文件不在目录中。


我转到指定的目录,而.exe文件不存在。我更改了目录但仍无法找到它。我通过输入.cpp添加了扩展名当我将新项目添加到源文件并仍然...时,我的项目


当我想创建项目时,我点击了新项目 - > win32控制台应用程序 - >空项目


然后我编写代码然后通过单击构建选项卡和构建解决方案构建解决方案。这是第一次成功构建但我无法编译它或者运行或调试。


我还在网上阅读了有关此事的所有答案,但没有人帮忙(包括重新安装。


我曾经跑过我的代码用VS6然后当我想编译我的代码时,一条消息被问到我是否想要创建一些运行项目所必需的文件但在VS2012中没有提出这样的消息。我想知道


如果有人真正面对并解决了这个问题。

解决方案


I写一个简单的代码:


#include< iostream>


int main()


{cout< ;<" hi";


}


构建并编译它但会弹出错误:"无法运行程序"。 exe文件不在目录中。





在尝试运行/调试程序之前先构建程序。



然后修复构建和重建中的所有错误。只有在
之后才尝试运行它所有错误都已消失。



将您的代码更改为:


#include< iostream>



int main()

{

   std :: cout<<" hi";

}



- Wayne


I write a simple code :

#include <iostream>

int main()

{ cout<<"hi";

}

build it and compile it but an error pops up : " unable to run program" .exe file is not in directory.

I go to specified directory and .exe file is not there.I change directory and still cant find it.I added the extension by typing .cpp to my project when I added new item to source file and still...

when I want to create a project I click new project --> win32 console app-->empty project

then I write my code then I build solution by clicking on build tab and build solution.for the first time its successfully built but i cant compile it or run or debug .

I have also read all answers in web regarding this matter and none have helped(including reinstalling .

I used to run my codes with VS6 and back then when I wanted to compile my code a message was poped up asking me if i want to create some files which are necessary to run the project but no such message is brought up in VS2012.I was wondering

if anyone had actually faced and solved this.

解决方案

I write a simple code :

#include <iostream>

int main()

{ cout<<"hi";

}

build it and compile it but an error pops up : " unable to run program" .exe file is not in directory.


Build the program first before trying to run/debug it.

Then fix all errors from the build and rebuild. Only try to run it after
all errors are gone.

Change your code to:

#include <iostream>

int main()
{
   std::cout<<"hi";
}

- Wayne


这篇关于Visul studio 2012 doent创建.exe文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆