NobleUplift
NobleUplift

Reputation: 6005

How do I generate a manifest file for libxml2.dll built on Windows?

I successfully compiled libxml2 on Windows after compiling libiconv:

http://www.codeproject.com/Articles/302012/How-to-Build-libiconv-with-Microsoft-Visual-Studio

And following this tutorial:

http://marlowa.blogspot.com/2013/07/how-to-build-libxml2-on-windows-using.html

And now I'm trying to generate a manifest file for libxml2.dll. How do I do this? I've Googled around and it says to create the manifest file in Visual Studio, but I'm compiling from the command line. This is the script I used to build it:

@ECHO OFF
CALL "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"
CD libxml2-2.9.4\win32
cscript configure.js compiler=msvc prefix=D:\Repos\libxml2\release include=D:\Repos\libiconv\release\include lib=D:\Repos\libiconv\release debug=yes
REM "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
nmake
nmake install
cd ../..

I get a "Module not found" exception on this line of my plugin, and I confirmed it was an issue with libxml2.dll because using a downloaded binary of the libxml2.dll, it works just fine.

https://github.com/NobleUplift/TeamSpeak3WebsitePreview/blob/master/ts3websitepreview/plugin.c#L148

Any and all help appreciated. I'm almost finished with this project that I've had bouncing around since 2011.

working libxml2.dll is on the left, broken libxml2 is on the right

libxml2.dll on the left works. Compiled libxml2.dll is on the right. It turns out the libxml2 being compiled doesn't have a zlib1 dependency, which might be the issue.

Upvotes: 1

Views: 640

Answers (2)

Martin Ba
Martin Ba

Reputation: 38766

(a) the current (2.9.4) configure script has a vcmanifest=yes|no option that does work, as far as I can tell.

(b) You do not need one. The manifest (as noted in the blog you link to) is required for vc80 (VS 2005) and vc90 (VS2008) because in these studio version, the msvcrt was resolved via manifest / WinSxS.

In vc10 / Studio 2010 and above, the msvcrt is again installed in the Windows\System32 location, and you do not need the manifest to load the crt.

From your dep-walker screenshot, what you're actually missing is iconv.dll and zlib1.dll and these don't require manifests either, but are required unless you compile with iconv=no zlib=no (which may not be what you want).

Upvotes: 1

nwellnhof
nwellnhof

Reputation: 33618

After running cscript configure.js and before running nmake, edit the generated Makefile and add /MANIFEST to LDFLAGS.

Upvotes: 1

Related Questions