# Compiling windows application for distribution

This topic is 3081 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi all, I have a sample program that i'm trying to test on other computers to see if it will run. The application is coded using in c++ using the windows api on Visual Studio 2008. I've tried the release .exe on a couple of different computers and always get the "Problem with application, finding solution... close program". Seems to be the same on xp and vista but it runs just fine on my own computer. Could this be something to do with the settings used to make the release build? I've never had to make an application that will run on someone elses computer before. Thanks!

##### Share on other sites
Hey, what kind of application is it? Does it require extra libraries (such as DirectX and OpenGL)? If so, you need to distribute the additional dll's.

##### Share on other sites
Quote:
 Original post by leet bixHey, what kind of application is it? Does it require extra libraries (such as DirectX and OpenGL)? If so, you need to distribute the additional dll's.

It's just a sample application for a windows wrapper library.
No directX or openGL just windows. The only library i link to is winmm.lib

##### Share on other sites
First of all, make sure you are making a release build. Especially check for the Runtime Library to not be a debugging library (see C/C++ -> Code generation -> Runtime library in your Project Options).

Second, make sure that the other computer has the Visual C++ 2008 redistributable. (available here or if you have Visual Studio 2008 SP1 here.

Third, if this doesn't help you can use Dependency walker to look at the DLLs that the test computers are missing.

Hope this helps. Good luck.

##### Share on other sites
Quote:
 Original post by DaBonoFirst of all, make sure you are making a release build. Especially check for the Runtime Library to not be a debugging library (see C/C++ -> Code generation -> Runtime library in your Project Options).Second, make sure that the other computer has the Visual C++ 2008 redistributable. (available here or if you have Visual Studio 2008 SP1 here.Third, if this doesn't help you can use Dependency walker to look at the DLLs that the test computers are missing.Hope this helps. Good luck.

Thanks.
Is there a way to build the executable so that it doesn't require the visual c++ redistributable?
Just seems like a lot of hassle to install for such a small program.
Thanks for the link to dependency walker, I was looking for something like that the other day.

In configuration properties->C/C++->Command line I have :
/O2 /Oi /GL /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FD /EHsc /MD /Gy /Fo"Release\\" /Fd"Release\vc90.pdb" /W3 /nologo /c /Zi /TP /errorReport:prompt

In ...->Linker->Command Line I have :
/OUT:"...\Release\Test.exe" /INCREMENTAL:NO /NOLOGO /MANIFEST /MANIFESTFILE:"Release\Test.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"...\Release\Test.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /LTCG /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

Don't know if any of that is relevant but no harm in putting it up.

EDIT :
Actually just saw the :
/DEBUG /PDB:"...\Release\Test.pdb"
I have gotten rid of that and will test again.

EDIT :
Still the same, I think tomorrow I'm going to have to install the Visual C++ 2008 redistributable on the other computers and see where I'm at.
Thanks for the help.

##### Share on other sites
Ok, i've installed the redistributable on both computers and I still get the same program has encountered an error ... needs to stop ... blah blah.

There is nothing in the program generated error file to suggest an error from my program so I'm at a loss as to what to do. I'll go through it with dependency walker soon and see if there is anything missing.

##### Share on other sites
Are you sure there are no bugs in your code? If the program needs to stop and close you may be trying to use a null pointer or an object that has not been initialized.

Does you code try to access a file on your hard drive that may not be there on another PC?

##### Share on other sites
Hi, I think you need to change from the multi-threaded dll (/MD) to just multi-threaded (/MT). I was having this problem and found this:

See how that goes.

##### Share on other sites
@ mmakrzem
I'm pretty sure there are no bugs in the code. It runs perfectly on my machine and the only file operations are creating a file error.txt next to the executable and writing the errors encountered to it. The file has been empty on all computers indicating no errors, or maybe that the program crashed before the file was closed which is unlikely but I'll still check for.

@ ugh666
I have changed the options and have had no change on the XP box I have access to (then again the install is plagued with errors and is just waiting for windows7 to be released for an upgrade lol), I am waiting to hear back from a friend testing on his Vista and Windows7 machines.
I have another Vista box that I can test but will only have access to it tonight.

Maybe it's a case of the fact that my computers set up for development and there's something I have that the other machines don't have, could dll version differences create problems like this?

I'll post back when I manage to test further.
Thanks again.

EDIT :
Using dependency walker I found that I was missing IEShims.dll so I have found that dll and now dependency walker states :
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
This comes from IEFRAME.dll which is meant to be in windows/system32, the dll is there so I guessed it must be too old a version, but my version is 8.0.6001.18813 and the only other version I can find online is 7.0.5346.5
Apparently the dll is missing some functions #159 #160 #165 etc...
And that's on my computer where the program runs just fine lol.

I'm going to run this on the other computers and see if I can find out what the problem is with them.

[Edited by - p0is0n on September 14, 2009 10:45:03 AM]