compiling LibXML2 in VC2005/08 and Mac Os env
I am writing a C开发者_JS百科 application which uses LibXML2 for XML parsing and Validation. Compiling it in Linux was pretty easy, though compiling it in Windows and Mac seems to be exacting.
For Windows, I am using VC2005/08 ( I basically have both the copies, hence would use on which ever its easier). I need to compile my application along with Libxml2 and other libraries. Most Importantly I need to compile this with MSVCRT.DLL and not with other CRT DLL Libraries like MSVCRT71.dll etc...
I need to build this for Mac Os as well.
Please advice on how should I go about this?
Once upon a time I setup a Visual C++ 2005 project file to build libxml2 from source. Amazingly I kept instructions on how I did some of it. This is for 2.7.4, so it may be different for the current version.
First you have to run the configure script; I did cscript configure.js iconv=no
as I didn't want to complicate things with another dependency (iconv). This generates some header files that define what options are available for the build.
Then you need to create a project file and add all the libxml2 source files to it. I set mine up as a static library that linked with the static C runtime, though you may want to change this for your needs. I had to add some definitions to my project file so that it would build a certain way; looking at my project file I see _REENTRANT;HAVE_WIN32_THREADS
. I don't remember what these mean, but I probably gleaned them from the makefile.
That's really all there is to it; configure, add the files, and set some defines.
精彩评论