Link to home
Create AccountLog in
Avatar of thready
thready

asked on

Converted project from VS2012 won't run on XP

Hi Experts,

I've converted a win32 console app (native c++ win32 and std libs) from VS2010 to VS2012.  I'm compiling with a platform toolset of "Visual Studio 2012 - Windows XP (v110_xp)".  This worked for all my applications except this one.

When I try to run my exe on XP- it's "not a valid win32 application".  I try dependency walker on it and the usual IESHIMS.DLL and WER.DLL are reported (as false positives) and then there's the one that I think is the culprit:  MPR.DLL (missing entry point for NetRestoreConnection)...  This is not needed and I think it's only loaded if needed...

So as a solution, I'm trying to statically link to MFC to remove _AFXDLL references, but having a very hard time compiling my large project this way...  Not sure if this is the right approach.

Thanks for any help!
Mike
Avatar of Zoppo
Zoppo
Flag of Germany image

Hi thready,

did you install the VisualStudio 2012 runtime redistributables (i.e. from http://www.microsoft.com/en-us/download/details.aspx?id=30679) on the XP machine? Or is VS 2012 installed there?

ZOPPO
Avatar of thready
thready

ASKER

Yes - the redist for vs2012 is installed on that machine.
Avatar of thready

ASKER

Is it notoriously difficult to statically link to MFC?  If yes, why???
Usually it should be possible to statically link to MFC, IMO the only thing to take care is the need to use static runtime C runtime too - to do this in VS 2010 select Multi Threaded (without DLL) in Properties->C/C++->Code Generation->Runtime Library, I don't know if it's the same in VS 2012.

But it maybe it's a problem to use a DLL which uses MFC but isn't linked statically ...
ASKER CERTIFIED SOLUTION
Avatar of Zoppo
Zoppo
Flag of Germany image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of thready

ASKER

trying that now...
Avatar of thready

ASKER

Zoppo- can I create another "dummy" question just for you so I can give you another 500 points!   ;o)

Thank you so much!  AWESOME!
Avatar of thready

ASKER

(the fix was to add SUBSYSTEM:CONSOLE with version 5.01.  Minimum version was already at 5.01, but I set 5.01 as THE version.  :o)
:) no problem, ont time 500 points is enough.

I'm glad I could help you ...

Have a nice day,

regards,

ZOPPO