# Portability of C++ programs



## wmhakim (Nov 15, 2008)

Hi All,
Something has been bothering me for a long time. I took a couple of C++ courses during my Comp. Sci. degree and was very successful in getting my programs to compile. I know you can run the executable after it has compiled and interact with it through the DOS screen. My question is: how does one use that executable? What I mean is, how can I take that executable and have it run on another computer or how are C++ codes used in applications? I know how to write a C++ program and compile it but don't know how it can be used after.

For example, VB.net programs: after compilation in the lab I could use a memory stick, save the executable to it and run that executable on another computer. Not so with the C++ ones. I know I am missing something but don't know what it is.

Any help on this subject will be helpful. By the way, I am not a programmer, just curious about how things work.
Thanks


----------



## Stu_computer (Jul 7, 2005)

http://www.literateprogramming.com/portablecpp.pdf


----------



## wmhakim (Nov 15, 2008)

Thank you Stu.
I will certainly have a read.


----------



## w112785 (Jan 17, 2008)

sounds like your problem is the C++ run-time. you said VB6 so i would assume you are using MS Visual Studio or at least Visual C++.
If you are using a newer version, say VC++ version 2008 on Windows XP then you will need to install the C++ run-time for that version
you have 2 options here 1. you can download the Microsoft Visual C++ 2008 Redistributable Package here
http://www.microsoft.com/downloadS/...34-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en

or you can static link the Run-time with your code so it is all in one but that is not recommended in case a bug is found with the Run-time so MS can patch it


----------

