Distributing an exe file compiled with Visual Stud

2020-04-19 18:55发布

问题:

I am trying to use Visual Studio 2013 to compile my C++ project and distribute it to some friends.

I have tried compiling it with Runtime Library set to /MD and having them install "Visual C++ Redistributable Packages for Visual Studio 2013", but it keeps giving the same error message "The program can't start because MSVCP120.dll is missing from your computer". I checked an MSVCP120.dll is in their System32 directory.

I also tried to compile it with Runtime Library set to /MT, but when they start the program it just stops responding.

I am just grabbing the exe out of my Release directory. Is there another step I should be taking? Not sure what is causing the issues otherwise. Both exe's work perfectly on my computer, just not on theirs.

Forgive me since this question seems to be asked a lot, but the answers I have found all involve installing "Visual C++ Redistributable Packages for Visual Studio 2013" which we have already tried.

Thanks in advanced for any advice.

回答1:

I think if you install the 32-bit redistributable, it should work.

I wonder if there is some other bug that is causing the /MT static version to not work. Unclear with the amount of information given, but that would be my thought.