Running c++ application built by MSVC++2005 Express Edition on Another Computer

Started by
3 comments, last by ExcessNeo 16 years, 10 months ago
My program can't run in my friend's computer which doesn't have visual c++. He told me that the program said incorrect configuration or something. I am using Microsoft Visual C++ 2005 Express Edition (Free One)
Advertisement
Compile the program in 'Release' mode.

Your friend probably doesn't have the libraries installed that you use.

Go to -> Properties and then do this:

http://img257.imageshack.us/img257/4530/naamloossh4.jpg

Then recompile your program. You will notice that your program is bigger in size now. Send this program to your friend and it should work!

Good luck!
i got this error after compiling

Linking...
MSVCRT.lib(wcrtexew.obj) : error LNK2001: unresolved external symbol _wWinMain@16
..\Visual Studio 2005\Projects\Tic-Tac-Toe\Release\Tic-Tac-Toe.exe : fatal error LNK1120: 1 unresolved externals

Well, Vinniee assumed a lot about your program when he offered his advice. We don't know if you have a Console program or a Win32 program or a windows program that uses MFC or ATL. Basically, you probably need to include the Visual C++ runtime library. Read this to find out more about the runtime libraries for c and C++.

In a nutshell, you'll want to look at the table labelled "Standard C++ Library". This lists four different libraries you can use. There are actually only two really different versions, the other two are debug versions for use when trying to debug your program. When giving the program to a friend you should probably just give the non-debug version. The non-debug versions of the library are either dynamically or statically linked. A dynamically linked lilbrary is a .dll file. This kind of file allows you to call functions without it being included directly in your program which decreases the size of your code.

However, not all computers come with this dll file. Which brings us to statically linking code. This will increase your file size by including all of the stuff in that dll file into your program, but it saves you the effort to distribute the dll file. You'll want to locate that option somewhere in the settings (I don't have MSVC++ around at the moment so can't tell you where) and select multithreaded static link non-debug version for release mode and the debub version for debug mode.

lastly, if you wish to use the dll versions you can also just have your friend install this file which should install the files needed.

Hope that helps a little.

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

In project settings head to C/C++->Code Generation then change the Runtime Library to Multi-Threaded(/MT) (itll most likely be Multi-Threaded Debug DLL (/MDd) currently).

This topic is closed to new replies.

Advertisement