Click here to Skip to main content
15,889,876 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
How do I create an .exe file from a mfc program (using VC++ 6.0).
I understand U need to compile & build the program and that will make an .exe
file in the Debug folder. I did that. But when I tried to run my .exe on other PC which doesn't have the vc++ software, it is showing a message- "This application can not be run, .DLL not found". I want to run my application without installing vc++ software in windows.
how can I solve it
please help me.
Posted
Updated 30-Mar-11 19:56pm
v2

You can't just build it as a "Normal" exe and move it to the other machine: it requires a number of support files (held in DLL's).

I don't have VC6 installed at teh moment, but there are two options:
1) I seem to remember that there is an selection in the "build options" for "stand alone exe" - but that may be from a previous version, I haven't done that for a while.
2) Use the InstallShield that came with VC6 to create an installation program for your app (recommended). There is an article showing what to do here: How to create customized InstallShield for a VC++ Application[^]
 
Share this answer
 
I don't understand why someone has downvoted your question... this is something that at the beginning happens to a lot of people... Of course a google search could have solved it, but sometimes the same poor knowledge makes it difficult to search for the right solution...

Anywyay, here's a link that will help you:

http://msdn.microsoft.com/en-us/library/aa260978(v=vs.60).aspx[^]

What you need is explained in detail.

Hope this helps...

PS: This should be a complement to the first answer you've received (the release linking is important).
 
Share this answer
 
v2
If you are creating your executable with VC6, you first have to make sure it is compiled in release mode. Once this is done, you have to copy on the target computer all the dll's which are required by your program. To know which ones are required, you can use a tool called "Depedency Walker" (google for it).
An alternative would be to statically link to all MFC and C-runtime libraries (this option is somewhere in your project settings).
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 31-Mar-11 2:51am    
Dependency Walker is a good ides, I always recommend it is such cases.
My 5.
--SA
This is not necesarily a dependency on VC++, which .DLL is missing?
If it's located in your project folder on the PC you compiled it on, simply copy it with your .exe to the pc you wish to run it on. If it's a third-party DLL you might need to install the software which included the DLL.
 
Share this answer
 
v2
You can solve this issue by compiling your exe with static libraries.
I did not remember the vc++6.0 IDE details,But you can follow the following general procedure,
Goto, Project->properties and change use of MFC to Use MFC in static library.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900