application configuation is incorrect ?

Ive developed a program in VC++ 2005, builded it with options Release for win32. I gave the .exe to a friend and he got this error.

this application has failed to start because the application configuation is incorrect. reinstalling the application may fix this problem

But it works perfect on my computer.

Whats wrong ? what application configuation ?
brightwoodAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AxterCommented:
What's your friend's OS, and does he/she have the latest updates?
0
brightwoodAuthor Commented:
Xp, same as me. He have sp2. All updates problably, same as me again.
But is it such platform dependant ? I mean won't my little program run on a win98 for example ?
0
jkrCommented:
Are you performing a 'Release' build? If not, it is most likely that your friend does not have the required debug runtime DLLs, thus the error.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

brightwoodAuthor Commented:
Yes as i said, ive done a "Release" build.
0
jkrCommented:
>>I mean won't my little program run on a win98 for example ?

If you compiled it with VS 2005, probably not, since the runtime is not present at all, not even in Release mode. You might have to write to write an installer, unless you choose to link everything statically. The latter includes both the CRT and the MFC libs.
0
AxterCommented:
>>But is it such platform dependant ?

You can create code that requires a minimum platform.  There are many applications that will not work on Win98/95.

What type of application did you build?
0
brightwoodAuthor Commented:
its a MFC dialog application. really nothing complicated.
0
jkrCommented:
Hmm, you better take a look at http://msdn2.microsoft.com/en-us/library/ms235299(VS.80).aspx ("Redistributing Visual C++ Files") and http://msdn2.microsoft.com/en-us/library/8kche8ah(VS.80).aspx ("Determining Which DLLs to Redistribute ") in particular.
0
AxterCommented:
>>its a MFC dialog application. really nothing complicated.

I recommend you compile MFC statically.
I'm not sure about the exact option location for VC++ 2005, but in VC++ 2003, you can set this option by right clicking your project in the solutions window, and then select properties.
Then select "general" which is listed right under the "Configuration Properties" tree.
Look for  a field called "Use of MFC"
Change this field to "Use MFC in a Static Library".

If you're using ALT, do the same.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jkrCommented:
>>I recommend you compile MFC statically.

That's what I already wrote above, but the same applies to the CRT. But anyway, both usually creates a bloated executable.
0
brightwoodAuthor Commented:
Axter, its same in vc++ 2005. And it works now on 2 of my friends computers. I wonder if it will work on a win98 also. Too bad I can't test it at this moment.
0
AxterCommented:
>>That's what I already wrote above

I should have said to add to jkr's comment.
0
jkrCommented:
Anyway, I don't like static linking, since it is known to become a major pain when more functionality is added (The "multiple ... symbols defined ... nafxcwd" nightmare)
0
jkrCommented:
Hm, shouldn't that have been more like a split, regarding the comment history?
0
AxterCommented:
I agree with jkr.

brightwood, can you please request to split the points?
0
AxterCommented:
FYI:
An alterantive to linking statically to MFC, is to copy the mfc*.dll files to your friends computer.  The dll files should go in the C:\windows\system32 path or the path of the executable.

If you look at your build machine, you'll seel mfc DLL's like the following:
mfc40.dll
mfc42.dll
mfc70.dll
MFC71.dll

But IMHO, it's far easier just to link statically.
0
brightwoodAuthor Commented:
If i link statically all this dll's gets included into the .exe right ?
0
brightwoodAuthor Commented:
Sure ill request that, link me where to.
0
jkrCommented:
Yes. But it's not only MFC you need, also the CRT.
0
jkrCommented:
Regarding the CRT part - in your project settings, under 'Code Generation', select 'Runtime Library' to an appropriate option that does *not* lit 'DLL'
0
brightwoodAuthor Commented:
Do that then jkr :)

My runtime library its set to "Multi-threaded (/MT)"

So, by just link statically my program should work under win98 too ?
0
jkrCommented:
Let's say that the chances are better. If the new MFC versions use APIs that aren't present or defunct on Win9x (and there could be a lot), it might not work either.
0
jkrCommented:
Oh, BTW - regarding Axter's pointer to the DLLs: You can also use the DependencaWalker from www.dependencywalker.com to check which DLLs are missing on the target machine.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.