I have an application that uses wxWidgets
as a the UI framework and compiled using Visual Studio 2010 on Windows 7 machine. I am linking wxWidgets
statically. My application also uses a C dll for processing.
Now I am trying to run this application on another freshly installed machine开发者_如何转开发 (Win7). This doesn't have a developer environment setup. I have copied the application's executable file, supporting dll and other supporting text files to this machine.
When the application starts, it gave the following message.
The program failed to start because MSVCR100d.DLL is missing from your computer. Try reinstalling the program to fix this problem
.
I figured that my C library was using debug version and compiling that in Release
mode solved the issue. But it still asks for MSVCR100.dll
. I think the way to workaround is installing the VC++ redistributable package. But not sure that is the best approach.
Here are my questions.
- How do you normally deploy the application? Do you provide the VC++ redistributable package too?
- I am compiling this on a 64bit machine and testing on a 32 bit. Is this OK? Or do I need to compile separately for 32 bit?
- Can I statically link against the run time library? So that I can just ship my DLLs and other files.
- What are the other common things that I should be aware of when building executable which will run on many machines?
Following are some of my settings which may be relevant.
General :
Use of MFC : Use standard windows libraries
Use of ATL : Not using
C/C++ :
Runtime library : Multi-threaded(/MT)
Any help would be appreciated.
It is trying to use a debug only DLL on a machine that doesn't have it.
Your problem arises from the fact that msvcr100d.dll is a debug only dll indicated by the trailing d.
Thus you are NOT using /MT you are actually using /MDd. If you used /MT then it would nto try and load that DLL ...
So in answer to your questions:
- I prefer to statically link against the run-time.
- Thats really not a problem. Just don't try and run a 64-bit compiled binary on a 32-bit OS.
- Yes.
- Beware of your minimum specification. ie Don't use SSE4 if you need to support a Pentium 3 ... etc.
This appears to be the same question as the second hit when I googled "will x86 exe work on x64"; it doesn't answer everything, but it has a few answers.
http://social.msdn.microsoft.com/Forums/en/netfx64bit/thread/5ad0ff2c-558c-43ba-a59d-9cd0a0785103
You can probably find more similar information if you look beyond the second one, and if you query for a few other things.
As for the VC++ runtime stuff, I avoid MS's C++ version like the plague myself and so have no experience with it, but still, I thought all modern Windows computers were supposed to have the necessary runtime components of all their stuff (VC++, .NET, etc) already included.
Yes, it is necessary to provide VC++ redistributable package. The best way is to make a setup package using Visual Studio Setaul and Deployment project.
It's OK if you compile 32 bits executable.
I don't recommend this, such huge executables don't look professional.
精彩评论