开发者

Statically link to the dll files

I have al开发者_JAVA技巧ready built a project, and run it in VS2010.

But if I want to run the .exe on other computers which does not install Visual Studio, it will need .dll files (such as msvcrt.dll and msvcp60.dll in WINDOWS\SYSTEM32, and some other dlls in the development package). I didn't use MFC in this project. How to static link all these dlls into the .exe file in Visual C++ so that I don't have to copy all the dlls to the other machines?

BTW: I don't want to make install package either

Thanks Siba


You can set your project to statically link the CRT, by using the /MT flag for the runtime library. Or, you could keep the /MD setting, and install the vcredist package along with your executable (you can get it from here, and also from one of your VS2010 installation folders). To get an idea of each options pros and cons, read this.

Oh, and a similar question has been asked before...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜