Visual C++ express relase compiling problem - Need help!

I’m currently working on my project and I’m trying to test it on other computers. First I build the project with Visual C++ express as release and run the exe. It runs fine on my computer, but after I send it to other computer and try to run my program the problems start.

First on the other computers, it requires MSVCP.dll. After downloading the dll, it requires another dll, MSVCR.dll. After the both dll’s are downloaded and pasted into the projects folder it gives this error message:

This happens when I compile the project to release with Multi-threaded Dll. I’ve also tried to compile it with Multi-threaded, but it gives an error message like:

1> Unit.cpp
1>msvcrt.lib(ti_inst.obj) : error LNK2005: “private: __thiscall type_info::type_info(class type_info const &)” (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>msvcrt.lib(ti_inst.obj) : error LNK2005: “private: class type_info & __thiscall type_info::operator=(class type_info const &)” (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>msvcrt.lib(MSVCR100.dll) : error LNK2005: _exit already defined in LIBCMT.lib(crt0dat.obj)
1>msvcrt.lib(MSVCR100.dll) : error LNK2005: _atoi already defined in LIBCMT.lib(atox.obj)
1>LIBCMT.lib(crt0init.obj) : warning LNK4098: defaultlib ‘msvcrt.lib’ conflicts with use of other libs; use /NODEFAULTLIB:library
1>C:\Users\Mikko\documents\visual studio 2010\Projects\tbs\Release\tbs.exe : fatal error LNK1169: one or more multiply defined symbols found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Thanks in advance for the answers.

Welcome to the world of DLL redistribution! It’s a nightmare on a scale only Microsoft could engineer.

So, your problem is simply that the system you run the application on does not have the same version of MSVC DLLs installed. This is a really common problem and quite easy to fix.
Your options are:

  1. Get the latest version of the MSVC redistributables from MS website (be sure to get the right ones for 2005 or 2008 versions) and install on the target PC (and supply with it, if you need).

  2. Set your compiler to static link everything (which I do, as my programs run on ~8000 systems which all have different versions of the MSVC DLLs installed!)
    Check what DLLs your application requires by using the Depends.exe program which comes with MSVC (if not, download it for free) and open your application - it will tell you DLLs it is looking for.
    In your project properties, ensure “Use of ATL” is set to “Static link to ATL”, and also “Minimise CRT use in ATL” is set to YES. Then check again with Depends.exe

  3. Learn about manifest files, and get even more confused. Not recommended.

Option 2 is your best bet, in my opinion. It makes your exe larger but means it will run on any system.

Hope that helps