[xml] Borland Compile Flags



Hello All,

Thanks to the help of several on this list I have figured out how
to use the stock libxml win32 DLL's provided in the borland environment
without modification.

If you download the dll from:
http://www.fh-frankfurt.de/~igor/projects/libxml/index.html

Unzip it.  Remove or rename the libxml2.lib file.  Use borland's implib
to create a dll import library for the dll:

implib -a libxml2.lib libxml2.dll

Then if you get iconv symbol errors during compilation, you want
to do your libxml includes like this:

/* ************************************************************* */
/* The libxml2 include files all assume a ms compiler and set of */
/* defines.  In order to get it to do what we need, we have to   */
/* set up those defines ourselves on a win32 platform.           */
/* ************************************************************* */

#ifdef _WIN32
#       ifndef WIN32
#               define WIN32
#       endif
#       ifndef _MSC_VER
#               define _MSC_VER
#               define UNDO_MSCVER
#       endif
#endif

#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/xmlmemory.h>

/* ************************************************************* */
/* Be sure and undo the msc_ver variable, because it will cause  */
/* trouble elsewhere with other include files that use it.       */
/* ************************************************************* */

#ifdef UNDO_MSCVER
#undef _MSC_VER
#endif

And finally, when compiling be sure to include the -WR flag to bcc32.
This will use the correct set of run time libraries.

Thanks alot for everyone's help.

Steven

-- 
==================================================================
== Steven M. Cherry                            smc cherrys org  ==
==                 http://family.cherrys.org/steven/index.html  ==
==================================================================




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]