Question:
Why wont Visual C++ make a .exe file?
the gullster
2008-04-23 13:16:35 UTC
I am using Visual C++ express edition to make Win32 Console Applications. When starting a new project, I select to create a blank Win32 Console App.
When I try and run/compile/debug my code it says that it can not find the relevant .exe file for my project so it can not run. Is there something I need to include/change for it to make the .exe?

e.g, my simple hello world app

#include

int main()
{
std::cout << "HelloWorld\n";
return 0;
}


refuses to create a .exe
any suggestions?
Five answers:
daniels_pa123
2008-04-23 13:34:39 UTC
why do you return 0 man



ur function and returns a constant

and by the way it will create exe file

u just save ur file and then compilate it and

voila

exe. :)

it wil be in obj

Debug folder if u didnt change anything
anonymous
2008-04-24 03:15:03 UTC
Use the wizard to make a simple hello world console app and don't change the main or stdafx lines. Run it as is.



If it is not running then there will be some errors in the code that you need to fix. Read the messages it puts out when it compiles.
J J
2008-04-23 13:22:38 UTC
in the solution check to make sure you are compiling it as an app and not a library file...

--

to answer the guy below me:

"why do you return 0 man" - because this is c++ and usually a small quick program returns zero.. the main can return a whole lot of things, but to end the main's run it needs to return something.



"ur function and returns a constant" - don't program in c++ much, do you?
remodwof
2008-04-25 07:39:50 UTC
Hmm... I Don't know but this might help...

DWOF - Simple Execution.

Create simple EXE Files to do Simple Tasks (such as display a message or input box, or write a registry value or create a text file... you can do almost ANY simple Execution with this program... And it only cost $10.00... Or you can download the trail version.

http://www.dwof.net
eevilcheese
2008-04-23 13:45:22 UTC
for visual studio, you need to add



#include


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...