1

I have written a simple C++ program and now I want to use it on a different computer.

I have used Visual Studio 2010 for development and I use in it just standard library functions (iostream, fstream, string etc), however when I try to run it on a Win XP machine it won't run. It sais the program need certain dlls to run.

What's the simplest way deploy the program so that, after compilation in Visual Studio it's not generated only the executable(.exe), but the .dlls too.

Note: I don't want to use Visual Studio Installer.

PS: I'll appreciate links to good articles about deploying an application.

3
  • Compile it with VC++ 6.0. From what I'm told, easy distributability is the one serious reason that that ancient compiler still exists :-) Commented Aug 8, 2012 at 17:48
  • 2
    You need to include the Viscual C++ Runtime library, or link against it statically. Commented Aug 8, 2012 at 17:49
  • How to choose the compiler / see which are the Visual C++ Runtime libraries(although I don't use them in my project) ? Commented Aug 8, 2012 at 17:51

2 Answers 2

4

As a comment above said, you can either link to the standard runtime in a static way (not 100% sure how to do that, though I'm sure you can google it) or you can install the redistributable runtime from Microsoft:

http://www.microsoft.com/en-ca/download/details.aspx?id=5555 (x86 or 32-bit) http://www.microsoft.com/en-ca/download/details.aspx?id=14632 (x64 or 64-bit)

So install those on the target machine, and then try your program.

Sign up to request clarification or add additional context in comments.

Comments

1

http://www.microsoft.com/en-us/download/details.aspx?id=5555

This link provides the distribution package for the C & C++ DLLs used by projects built with VS2010.

Please note the supported operating systems, namely:

Windows XP with Service Pack 3 (all editions except Starter Edition)

http://msdn.microsoft.com/en-us/library/zebw5zk9(VS.100).aspx

This link is a guide for deployment so endusers don't need to hunt these libraries down themselves. Also, just an FYI, there is a difference between release and debug builds and I highly doubt the installation from the first link provides any debugging builds of the runtimes.

3 Comments

I want to provide the .dlls myself(just the ones I use) without the user having to install anything.
msdn.microsoft.com/en-us/library/8kche8ah Link provides an exhausting list of DLLs based on dependance. Package these in with your application. Likewise, as others said, you couldlink your application to the static libraries and this would remove the headache of distributing the DLLs.
That's what I needed. Add the link in your answer and I'll accept. Thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.