Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent!!Howto Run win32 console c++ app. in a machine without VS 2003

Status
Not open for further replies.

kingsree

Programmer
Oct 9, 2005
5
0
0
US
Hello all,

I have a working win32 console c++ application. I developed the application in a machine(XP Professional) which had an installed copy of visual studio .NET 2003.

now my question is this? Is there a way in which I can statically load all the required libaries into the executable while building it itself, such that i can just grab the executable and run it in another machine(windows XP Professional, but does not have visual Studio .NET 2003 installed)??

Or does every system that executes the c++ application, needs to have a copy of VS.NET 2003 installed?

Or is there any other alternative?

Kindly help me out. It's kinda urgent.

kingsree
 
Look for depends.exe - it should be on your VS2003 disk under unsupported programs or something like that. Alternatively, if you have VS6, there should be depends.exe on it. Run it up, pick the name of your executable and it will tell you what DLLs it uses and where they live. You will probably find that everything you need lives in windows/system32.

All you will probably need to install on other machines is msvcrt.dll or msvcrtd.dll
 
Also, if you're using MFC classes in your program, choose to statically link them instead of dynamic. The more stuff you statically link rather than dynamically link, the less DLLs you'll need to copy (but your exe will get bigger).
 
hello xwb and cpjust,

No I'm not using any MFC classes in my application. Also I searched my visual studio .net 2003 cd's for depends.exe. I'm not able to find them.

can u let me know where i can find the "depends.exe". Also how I should go about using it.

I also don't have VC++ 6.0 with me.

thanks
sree

 
If you run your program on a machine that doesn't have VC++ on it, if you need any extra DLLs it should tell you which ones. You can then copy each of the DLLs that it wants from your VC++ machine to the other one.
 
Check Project|Settings C/C++ Tab, Code Generation category.
Don't use MT DLL in this list (/ML|/MT options, no /MD).
May be it helps.
 
I think you need not do such self-binding.
What you need to do is just write programm in C/C++. And compiled it. When it does work, then its exe file can also run on an another maschine under windows .

For example, you write a program likeas HelloWorld program,

#include <iostream>
#include <cstdlib>
using namespace std;

int main()
{
cout<<"Hello World!"<<endl;

system("pause");
return 0;
}
when you work with some IDE, for example VS 6,0
now compile this program and run it. And its exe file can run anywhere under windows.

When you have not VS 6,0, you can download DEV, it is free.
 
kai2005: The simple example you posted can run just as the .exe by itself, but more complex programs that make a lot of Windows API calls or use 3rd party DLLs have no choice but to copy the other DLLs as well as the .exe.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top