Search code examples
cvisual-studio-2010manifestlibxml2nmake

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.


Solution

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