Creating static linked Applications on Visual Studio 2005 – Compile one executable file to run alone
So you need to develop some applications to your enterprise, and you need to call some c++ ou vc++.
Everything is working but when you deploy your application, common is one executable, it gives error and says
“This Application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.”
And you start to scratch your head.
So what is the problem:
- You want to just deploy or execute one simple program compiled no dlls, ou another files;
- You want it to be easy, just click and run
Now the solution:
In Visual Studio, you have to tell it to compile and link the dependencies and libraries together in executable.
Now stop talking and let´s go to solution:
- Open the Projects Proprierties
- Go to Configuraration – General
- In the use of MFC choose statically like in the picture below
4. After that go to Linker -> Input and put all your libs that your executable needs like picture below:
Build it and be happy!
Did you like it? Resolve your problem? Please be nice and leave a comment it is comforting






November 27th, 2007 at 5:47 pm
Thank you so much! We needed this for school, had 4 houres left to find the solution and thanks to you we DID!!
This is working so great
( don’t forget to put the .dll files of which you include the .lib to the dir of the .exe!)
THANKS!
February 25th, 2008 at 2:33 pm
Thanks a lot. It was helpful.
March 26th, 2008 at 7:11 pm
Excelent.. that works..
Thanks…
April 19th, 2008 at 2:04 pm
sweet and simple… Thanks
June 22nd, 2008 at 9:40 pm
You are a life saver, thank you so much. I read at least 20 other threads on the subject and was just about to give up.
October 16th, 2008 at 4:00 am
from doc:
If you prefer static linking, do the following for each project in your solution: Go to Properties | Configuration | C/C++ | Code Generation | Runtime Library.
Release: Change /MD to /MT, Multithreaded.
Debug: Change /MDd to /MTd, Debug Multithreaded.