On Tue, Nov 11, 2008 at 6:13 AM, Daniel Cavalcanti wrote:
> Yeah I've had this problem before. Try running depends.exe on your bad
> executable, that should tell you which are the missing DLLs.
>
> If they are msvc**** then you have 2 choices:
> Either change the linking settings from all projects from MD to MT (dynamic
> to static) or find those DLLs in your system and paste them in the directory
> of the application.
>
Ok, got the problem now. Before explaining the fix I'll explain the
background.
I installed OpenSSL, GD, zLib and Boost. The later 2, zLib and Boost,
compiled with VS2005. Everything worked out great until I switched from
VS2005 to VS2008. Suddenly I started getting the same error as Duschan.
The error is this, if you run the debug application (WinXP, VS2008) you get
a "The application has failed to start error.". Browsing through the
dependencies with Dependency Walker you'll see that msvcp90.dll and
msvcr90.dll, the CRTs dlls for C and C++, are missing... the strange thing
is, they are installed in the system (just check the side-by-side
distribution at WinROOT/WinSxS... VS2008 installs the redistributable CRTs).
The problem is this, your application (wt) is being compiled to use VS2008's
CRT while the old libraries (mainly zlib and boost) were compiled for
VS2005's CRT. This will lead to all kinds of strange behavior, mainly the
error.
Now the fix:
A quick search through google revelead several people with the same error,
most of them had one thing in common: Boost. So I started thinking this was
a problem with Boost's precompiled binaries. Recompiled boost, like, 3
times... using bjam. Still the same error. After feeling frustrated I
remembered that zLib was too compiled with the VS2005 so the linking error
must be there. Recompiled zLib, everything works great now.
The problem at hand is that everything (well, mainly zLib... not sure about
gd, Boost and OpenSSL) is set to dinamically use the CRT (linker with /MD
and /MDd). Thus, they will all use msvcr90.dll and msvcp90.dll, VS2008's
CRT. And this should be a good thing, I mean, we all want small executables.
Problem is, most winxp and probably vista systems were not updated by M$ to
install VS2008's runtime, that is, if VS2008 is not installed the system
will lack the runtime and the error will occur.
The fix for this is:
1 - Ship VS2008's redistributable with your wt application or...
2 - Recompile everything (zlib, gd, boost, openssl) with /MT and /MTd, for
static linkage. Your final executable will be huge but portable.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest