Converting .cpp to .exe

S

splinter

Hi, my first post..

How do i convert the C program to a .exe file where like any othe
programs, double click on a icon and the program is launch.

I'm using MS Visual C++ .Net 2003.

Thanks


-
splinte
 
B

Bruno van Dooren

Hi, my first post..
How do i convert the C program to a .exe file where like any other
programs, double click on a icon and the program is launch.

I'm using MS Visual C++ .Net 2003.

Thanks.

Hi,

If you already have a C program that contains the code for a program ( a
hello world program for example), you can create an empty win32 project. you
then add your file to the project, set the correct project properties
(output name etc.) and simply build the application.

If you are new to C++, configuring your project settings could take some
time.
To get started, you can also create a new Win32 console project.
for example: if your project is named 'hello', then you open hello.cpp,
remove the main function, and copy your existing program into hello.cpp.
that way you can build your application with the default project settings.

Note: you have to leave the line that says '#include "StdAfx.h"' in
hello.cpp. otherwise the compiler will complain, since it expects to find
that directive. This is because that file is used to generate a precompiled
header.

There are a few other ways to get you started, but I think the above one is
the simplest one.

after you built your program, the exe file will be located in the output
directory. you can then simply double click it to launch it.

--

Kind regards,
Bruno.
(e-mail address removed)
Remove only "_nos_pam"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top