c++ - App does not run with VS 2008 SP1 DLLs, previous version works with RTM versions -
since our switch visual studio 6 visual studio 2008, we've been using mfc90.dll , msvc[pr]90.dlls along manifest files in private side-by-side configuration not worry versions or installing them system.
pre-sp1, working fine (and still works fine on our developer machines). we've done testing post-sp1 i've been pulling hair out since yesterday morning.
first off, our nsis installer script pulls dlls , manifest files redist folder. these no longer correct, app still links rtm version.
so added define _bind_to_current_vclibs_version=1
of our projects use sp1 dlls in redist folder (or subsequent ones new service packs come out). took me hours find this.
i've double checked generated manifest files in intermediate files folder compilation, , correctly list 9.0.30729.1 sp1 versions. i've double , triple checked depends on clean machine: links local dlls no errors.
running app still gets following error:
the application failed initialize (0xc0150002). click on ok terminate application.
none of searches i've done on google or microsoft have come relates specific issues (but there hits 2005 error message).
any 1 had similar problem sp1?
options:
- find problem , fix works should (preferred)
- install redist
- dig out old rtm dlls , manifest files , remove #define use current ones. (i've got them in earlier installer build, since microsoft blasts them out of redist folder!)
edit: i've tried re-building define turned off (link rtm dlls), , works long rtm dlls installed in folder. if sp1 dlls dropped in, gets following error:
c:\program files\...\...\x.exe
this application has failed start because application configuration incorrect. reinstalling application may fix problem.
has no-one else had deal issue?
edit: grins, downloaded , ran vcredist_x86.exe vs2008sp1 on test machine. it works. sp1 dlls. , rtm linked app. not in private side-by-side distribution worked pre-sp1.
i have battled problem myself last week , consider myself of expert ;)
i'm 99% sure not dlls , static libraries recompiled sp1 version. need put
#define _bind_to_current_mfc_version 1 #define _bind_to_current_crt_version 1
into every project you're using. every project of real-world size, it's easy forget small lib wasn't recompiled.
there more flags define versions bind to; it's documented on http://msdn.microsoft.com/en-us/library/cc664727%28v=vs.90%29.aspx . alternative lines above, can put
#define _bind_to_current_vclibs_version 1
which bind latest version of vc libs (crt, mfc, atl, openmp).
then, check embedded manifest says. download xm resource editor: http://www.wilsonc.demon.co.uk/d10resourceeditor.htm. open every dll , exe in solution. under 'xp theme manifest'. check 'version' attribute on right-hand side '9.0.30729.1'. if it's '9.0.21022', static library pulling in manifest old version.
what found in many cases, both versions included in manifest. means libraries use sp1 version , others don't.
a great way debug libraries don't have preprocessor directives set: temporarily modify platform headers compilation stops when tries embed old manifest. open c:\program files\microsoft visual studio 9.0\vc\crt\include\crtassem.h. search '21022' string. in define, put invalid (change 'define' 'blehbleh' or so). way, when you're compiling project _bind_to_current_crt_version
preprocessor flag not set, compilation stop , you'll know need add them or made sure it's applied everywhere.
also make sure use dependency walker know dlls being pulled in. it's easiest install fresh windows xp copy no updates (only sp2) on virtual machine. way know sure there nothing in sxs folder being used instead of side-by-side dlls supplied.
Comments
Post a Comment