Turning a C++ Project into an .exe

closed account (365X92yv)
How do I go about taking a project that has been coded in C++ and make it so that anyone's computer can use it. I've tried copying the dll that it needs but it doesn't work. And the only other hitch is that if it requires you to have Visual Studio for it to work that it would hinder the use of my program. Any help in this area would be fascinating.
Unless you cross compile the program, it won't work in other Operating Systems, if you are using standard c++ and no other external libraries (like boost, or SFML) you just need to run the .exe file on the other persons computer (and assuming it has the same Operating System as yours) it should run without any problems.

if you are using an external library, then are you using the static or dynamic versions? dynamic means you get a bunch of .dll files which need to be in the same folder as your .exe file, static means the external libraries get compiled into your .exe so you don't need .dll files.
closed account (365X92yv)
Well I'm using Visual Studio 10 on Windows 7 and I'm trying to get it to run on another laptop with the same OS but no Visual studio.

My goal is to be able to shove my program on mediafire or some other outlet and allow people to download it and use it. I dont know what you mean though by static and dynamic libraries. Is there a cover-all I can use to just blanket grab any dll's or anything I may need in the program or would that be a waste of space?
if you don't know about static/dynamic libraries then you aren't using an external library, simply running the .exe on your laptop should work fine.
closed account (365X92yv)
I get two errors. The first is a "cant find" this dll file thing. So I took the dll off the first computer and copied it to the target computer. Then I get a run error, something about failed to start followed by some gibberish, (0x0a0b0) or something. I just wanted to test it out on another computer and to no avail.
what is the .dll called? is it a system .dll? the gibberish is probably because it wants a specific .dll, not the one you had on your other computer.

edit: maybe you are using an external library, even without knowing what static/dynamic means, in your program what #includes do you have?
Last edited on
closed account (365X92yv)
#include <iostream>
#include <string>
#include <iomanip>

those are standard c++ libraries, you shouldn't need a .dll, you still haven't mentioned what this .dll is called.
closed account (365X92yv)
MSCVP100something.dll
http://www.optimize-your-pc.org/how-do-i-fix-the-msvcp100-dll-error

I never knew projects made with visual studio needed a .dll for it to run, if you aren't too attached to it already, I would switch to something not made by Micro$hit, such as code::blocks.

although I don't recommend downloading anything from that site, looks shady, do a search for the dll.
Last edited on
MSCVP100.dll is the standard dynamic runtime library for C++ applications. Just change your project not to use dynamic linking.

Right click your project's name in the Solution Explorer and choose Properties from the context menu.

The setting you want is under Configuration Properties -> C/C++ -> Code Generation.

Change the Runtime library to Multi-threaded (/MT).
Last edited on
closed account (365X92yv)
Yeaaaaa so I did that...... went to compile my project...... got 47 errors, mostly linking errors. Looks like I'm just gonna keep it as is.
You probably needed to do a clean rebuild.
closed account (365X92yv)
Here's what my output from trying to build looks like....

EDIT:
This is after cleaning the solution and project and rebuilding.


1>------ Build started: Project: LeagueTimer, Configuration: Debug Win32 ------
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>libcpmtd.lib(xdebug.obj) : error LNK2001: unresolved external symbol __free_dbg
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __free_dbg
1>main.obj : error LNK2019: unresolved external symbol __free_dbg referenced in function "private: void __thiscall std::_Yarn<char>::_Tidy(void)" (?_Tidy@?$_Yarn@D@std@@AAEXXZ)
1>libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol __free_dbg
1>libcpmtd.lib(cin.obj) : error LNK2001: unresolved external symbol __free_dbg
1>libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external symbol __free_dbg
1>libcpmtd.lib(cout.obj) : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "public: char const & __thiscall std::_String_const_iterator<char,struct std::char_traits<char>,class std::allocator<char> >::operator*(void)const " (??D?$_String_const_iterator@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDXZ)
1>libcpmtd.lib(cin.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>libcpmtd.lib(locale0.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "public: class std::_Yarn<char> & __thiscall std::_Yarn<char>::operator=(char const *)" (??4?$_Yarn@D@std@@QAEAAV01@PBD@Z)
1>libcpmtd.lib(xdebug.obj) : error LNK2001: unresolved external symbol __malloc_dbg
1>libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __malloc_dbg
1>libcpmtd.lib(_tolower.obj) : error LNK2019: unresolved external symbol __calloc_dbg referenced in function __Getctype
1>C:\xxxxx\xxxxxxxxxx\xxxxxxxxx\Visual Studio 2010\Projects\LeagueTimer\Debug\LeagueTimer.exe : fatal error LNK1120: 4 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Last edited on
I assumed you were doing a release build since you were distributing.

For the debug configuration, use the Multi-Threaded Debug (/MTd) Runtime library setting.
closed account (365X92yv)
So when I'm ready to move the program, swap the setting, but for testing and tweaking, keep it at /MTd?
As long as you're using the debug configuration, use /MTd. There are settings for each of the configurations.

If you use the release configuration, use /MT.

If you go up to the point where you would change the Runtime library setting, if you look near the top of the settings window you will see that you can specify settings for debug or release configurations. Whichever the project is set to use currently is the one shown by default. Note that selecting a configuration here will just allow you to change settings for that configuration. It won't actually change the configuration of your project.
Topic archived. No new replies allowed.