0

So I compiled a C++ code which uses the Boost library (if that's significant) with Visual Studio 2012 and am currently testing the executable on different machines with Windows. On some it works fine while on the others it gives an error that it couldn't find MSVCP110D.dll and will therefore not run. Is there any other way to make it run that creating an installer which would include the DLL? Can I somehow compile the DLL into my executable so that it runs even on machines without the proper libraries?

4

5 回答 5

2

You're linking against the debug CRT. Change that to the release one, and you can then redistribute the required DLLs as part of your install (it is not legal to do so with the debug ones)

于 2013-06-16T20:05:27.437 回答
2

MSVCP110D.dll is a runtime library. You can link to the runtime libraries statically. Go to Project Properties->Configuration Properties->C/C++->Code Generation and set the Runtime Library to /MT in Release mode and /MTd in debug mode. Alternatively, make sure that Visual Studio 2012 redistributable is included in your installer package.

于 2013-06-16T20:05:30.470 回答
0

You can statically link it. I am not sure about Microsoft Visual studio, but using GCC, you can use the -static option.

于 2013-06-16T20:02:34.760 回答
0

Compile your DLL code to a static library (LIB file), and link your EXE with that.

于 2013-06-16T20:02:52.580 回答
0

I understand that you wish to avoid using an installer, but are you aware of this free, powerful and quite easy to use installer: NSIS (made by the same guys who wrote WinAmp)

Here are other choices. Perhaps you can find one that just makes it easy enough (at the right price) that you might change your mind on not wanting to use one.

于 2013-06-16T21:22:02.313 回答