The executable runs fine on the computer that built it, but running it on another computer will fail with the following error:
The application failed to initialize properly (0xc0150002)。
Dependency walker reports the following error:
Error: The Side-by-Side configuration information for "c:\documents and settings\********\desktop\svnindexer-0.1.1-binary-lean\SVNIDX.EXE" contains errors ..... (14001).
The executable is built under Windows 7 with both VC8.0 and VC9.0 runtime installed, while the deployment target runs Windows XP with no dependencies installed before the test.
Installing VC9.0 redistributable cannot solve this issue. Install VC8.0 redistributable will also not resolve this issue.
SxS is not working, fix this before v0.1.1 installer can go out.
Two dependencies need to be removed.
1 msvcr90.dll
2 msvcp90.dll
The first is the standard C runtime, while the second is the standard C++ runtime, which sneaked in with the STL includes.
An article (http://kobyk.wordpress.com/2007/07/20/dynamically-linking-with-msvcrtdll-using-visual-c-2005/) shows that the old msvcrt.dll is still usable via the WDK release. This solves half of the problem.
The STL dll is somewhat a tricky one (in the end, what's the point of making a template library depend on a DLL? ), we have both msvcp80.dll and msvcp90.dll in WDK, but what the msvcprt.lib provided in WDK is for?
stlport is tested to see if is possible to substitute STL provided by MS, and stlport is also unable to completely avoid it.
The "bad_alloc" portion of stlport is linked against msvcp90.dll, because this portion needs compiler support to implement (From stlport support forum, on SF.net).
P.S:stlport is incompatible with the compiler's exception handling (/Ehs), turn it off to avoid a bunch of LNK2001 errors.
Also, I am accidentally mixing VC80 runtime and VC90 runtime, thus making the matter even worse. Libraries from Subversion are built against VC80 runtime, and now the executable is against VC90. As I tried to switch from VC90 to MSVCRT.dll in Windows system, the import libs fail to link because they are missing some functions not found in msvcrt. If I can pass this, then I can substitute the Dlls to avoid MSVCR80.dll (Not safe).
Maybe it is time to switch back even more, to VC6 environment, and rebuild the whole chain of libraries.
8.0.50727.4053 of MSVCR80.dll is needed to run the exe correctly.
(See this update : http://www.microsoft.com/downloads/en/details.aspx?familyid=766A6AF7-EC73-40FF-B072-9112BAB119C2&displaylang=en\)
MS distributed a security patch, and Windows XP does not have it installed.
The horrible mixing of libraries is still a problem by itself, and the installer will be bloated. But that can be fixed in future. For now, postpone this.