tags:

views:

23

answers:

1

My application which is built on VC++ 2008 , when run on a freshly installed XP shows an error that asks dotnet.fx to be installed. And also i faced similar problem when i tried to run it on another xp system after i installed that, it started to run.

Is there any way that i can make my application independent of all these additional installs ?

+1  A: 

Are you sure you didn't compile managed C++ (targetting CLR) instead of real C++. In the former case dotnetfx is the .NET runtime you absolutely need and not some optional addon. In the latter case you need only the VC_redist in either x86 or 64bit variant. That installs the C and C++ dlls only. These are side-by-side assemblies and must match the version you compiled for.

jdehaan
Ya, i complied managed C++(/clr). Does this has any effect on it.
rajivpradeep
Yes, then you need .NET 3.5 on the target machine in your case (VC++ 2008) that means installing dotnetfx.exe. Managed C++ is not C++ (looks like but is not).
jdehaan
So, how should i recompile it so that it doesn't ask for .NET 3.5.
rajivpradeep
Compile without CLR but there is a high chance that you have to rewrite many parts of your code if you wrote in managed C++. Then there is a dependency on the side-by-side assemblies (redistributable VC_Redist).
jdehaan
I am ready to recode it, when i remove the option of /clr in project properties and build it, i get the error as : fatal error C1190: managed targeted code requires a '/clr' option.Not allowing me to move furthur
rajivpradeep
Easiest would be (depending on the size of your project) to retain the .NET 3.5 dependency. I do not see the problem. On the contrary, you are architecture independent this way and .NET 3.5 comes pre-installed on Windows 7. I can read from your comments that you do not know what C++ really is. So maybe better for you to keep your fingers away from it.
jdehaan