views:

750

answers:

2

I have a weird problem when running an application that uses GNOME's libxml2 under Visual Studio 2008 (VS2008-SP1) and Windows XP.

I have two C++ projects:

  • Project A (a library)
  • Project B (an application that depends on Project A)

Both under one VS solution.

Project A is statically compiled with libxml2.lib. I've added dependencies to the library in both projects A and B.

Solution compiles perfectly. The only thing is, when I run it, I am getting the following error under Windows XP:

"This application has failed to start because libxml2.dll was not found. Re-installing the application may fix this problem".

I have tried this in two different Windows XP SP3 installations. And the weirdest thing is that it runs perfectly fine on Windows Vista, and I don't think it should be looking for DLL since it's statically compiled. Right?

Any ideas?

+3  A: 

Assuming you've checked the obvious (is libxml2.dll present on the XP machines?) you might find Dependency Walker helpful - it will provide more detailed errors and logging than Windows will give you on its own.

Probably it's a dependency of libxml2 itself that's missing - Dependency Walker will tell you what that dependency is.

RichieHindle
I should have mentioned that I compiled it statically. I don't think I need DLL in that case. I am going to update my question to reflect it.Great utility Dependency Walker: Thanks!
Pablo Santa Cruz
+3  A: 

Considering that libxml2 is Gnome based project, I'm guessing it doesn't come by default on any Windows installation.

I'm betting the reason it works on Vista is that you have a different program installed on Vista which happens to include that library. Hence it works there by accident and not design.

I agree with Richie. The best way to tackle this problem is to get out DependencyWalker and see what dependency is failing on XP but not Vista. This will lead you to your problem.

JaredPar
Your guessing was 100% accurate. Thanks.
Pablo Santa Cruz