Re: [xml] Building libxml2 as a DLL under MinGW MSYS

Igor Zlatkovic <igor stud fh-frankfurt de> writes:

Hi there,


Finally, there was a suggestion about introducing that LIBXML_EXPORT
macro in every public function declaration. In the unlikely case of
acceptance, the makefile would not stand in the way anymore.

As far as I can tell, Mingw needs to export/import the global data to
work correctly with DLL's. I added this to config.h to allow the build
of xmllint and the test programs:

#define LIBXML_DLL_IMPORT  __declspec(dllexport)
#define LIBXML_DLL_IMPORT  __declspec(dllimport)

config.h may not be the best place for these to go but I was just
trying to make the xmllint et. al. compile.

The deal is that mingw needs the global *data* to be wrapped with the
__declspec(dllexport | dllimport) and to the best of my understanding
the functions are not nearly as big of a deal and do not need them.

* Separate the winsock error codes from win32config.h in their own file and
#include that file in win32config.h. This would equally not affect any other
platform. That step would change nothing now, but would allow for avoiding
duplicate information incase the native and the cross-compiler mingw would
do their configuration through the GNU autoconf.


The double compilation run I have tested on xmlsec and it works fine. Note
that I plan to do this on both libxml and libxslt.

Any objections, suggestions, cries, cheers?

I think you are doing a wonderful job and thank you for your
consideration of those, like myself, who like using mingw.


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