954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to create a exe file in visual C++

anyone please guide me to create a exe program in visual C++ 2005.

Thank you

shorty001
Newbie Poster
4 posts since Jul 2007
Reputation Points: 10
Solved Threads: 0
 
Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

I already checked that one, it only guide us how to make a program ( how to begin to write the code into the editor), not a exe program. I need a guide to make a real exe file.

shorty001
Newbie Poster
4 posts since Jul 2007
Reputation Points: 10
Solved Threads: 0
 

To be able to create an Exe file in Visual C++ (I hope by your context you are using 6.0) you need to have fairly good knowledge of C++. next an Exe application can be of two types Console based / Graphical User Interface. For console based you can use Win32 Console APllication (as Ancient Dragon has guided you to the tutorial) and code in the ToDo areas for what operation you want to do. Next compile and build the program. This way u can create a console based exe.

For Graphical based exe you have to learn a bit more of MFC before proceeding.

Please revert back to us in case of more clarification.

shouvik.d
Junior Poster
198 posts since Jan 2007
Reputation Points: 64
Solved Threads: 7
 

HAHAHAHA.

What's so "fairly good understanding" about being able to write

int main(char* args, int argv)
{
    return 0;
}


and pressing a button or key?

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 
I need a guide to make a real exe file.


Type all of your code into the visual C++ editor and then press ctrl+shift+b. That builds your project and creates an exe file in the Debug or Release folders of the project folder. You can also do it the clicky way from the Build menu in visual C++. You can also use F5 to build and run in debug mode immediately, or ctrl+F5 to build and run in production mode immediately.

The tutorials that you said weren't helpful describe how to build projects here . But that's probably too much information if all you want is to build simple programs.

Hamrick
Posting Whiz
325 posts since Jun 2007
Reputation Points: 180
Solved Threads: 34
 
To be able to create an Exe file in Visual C++ (I hope by your context you are using 6.0) you need to have fairly good knowledge of C++. .

Nope -- only need a very basic knowledge of c++ to write console programs with the compiler. But it does take some time for newbes to learn how to use the IDE. How to do that depends on which version of VC++ you are using -- version 6.0 is a lot different than 2005.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

In general, the steps to getting MSVC++ 2005 to work should be something along the lines of

- Create a new Solution, using a Win32 Console Project

- Right-Click on the project's name in the solution explorer, choose properties.

- In the Configuration Properties Window, look for the option to disable precompiled headers (Under the C/C++ Configuration properties)

- Get rid of stdafx.h and all that rubbish

- use the simplest possible program to test whether you've set it up correctly (you can tell by whether the program compiles) this one will do

int main()
{
}

- Hold [CTRL] and press [F5] to compile & run. (Console Window won't auto-close - this is the 'compile without debugging' mode)
- or, [F7] to build it without running

- if you need the .exe file, look in the project's folder on your computer, in Windows Explorer. The .exe file will be named after the solution.

Bench
Posting Pro
577 posts since Feb 2006
Reputation Points: 307
Solved Threads: 63
 
6.0 is a lot different than 2005.


That is what takes developers a lot of time to port programms from one version to another. So atleast a fair amount of knowledge would be necessary in order to know how and what is working inside a program.

Tell me if i'm wrong.

shouvik.d
Junior Poster
198 posts since Jan 2007
Reputation Points: 64
Solved Threads: 7
 

most people would choose to start from scratch when starting development in VC2005 if their previous version was VC6.

Anything developed that long ago that VC6 was current when development was complete will be in dire need for such a major overhaul that complete replacement is a better option.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

Type all of your code into the visual C++ editor and then press ctrl+shift+b. That builds your project and creates an exe file in the Debug or Release folders of the project folder. You can also do it the clicky way from the Build menu in visual C++. You can also use F5 to build and run in debug mode immediately, or ctrl+F5 to build and run in production mode immediately.

The tutorials that you said weren't helpful describe how to build projects here . But that's probably too much information if all you want is to build simple programs.

sorry, I did not mention early which version I am using, I am using the 2005 version.Before I using this compiler, I use another compiler and it give me the exe file different from this one. The exe file created in this compiler automatically exit if I do not have the stop code.This mean when I try to test this compiler,I wrote the simple code and compiled it,then I click on the exe file, it run and exit, it happens so fast so I could not see anything.That's why I asked you how to do it,but actually I already did it.

when I read the comment above. I realize that I did correctly.So I check it that way.Thank you hamrick and all of you were trying to help me.

shorty001
Newbie Poster
4 posts since Jul 2007
Reputation Points: 10
Solved Threads: 0
 

There's no difference in the output, only in the way the IDE treats it when you run it inside the IDE...

Or if the other IDE and compiler did put in some magic code of their own, they were fundamentally flawed.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

There's no difference in the output, only in the way the IDE treats it when you run it inside the IDE...

Or if the other IDE and compiler did put in some magic code of their own, they were fundamentally flawed.


there are different, one needs the system("pause"), one do not need because my previous compiler do not need it

shorty001
Newbie Poster
4 posts since Jul 2007
Reputation Points: 10
Solved Threads: 0
 
there are different, one needs the system("pause"), one do not need because my previous compiler do not need it

You don't need to do that in VS2005. Read my post earlier in the thread.

Bench
Posting Pro
577 posts since Feb 2006
Reputation Points: 307
Solved Threads: 63
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You