Re: [xml] Dynamic Linkage And MSCC

Hi Igor, All,

I'm undecided on this issue, as both approaches have drawbacks. And 
for my setup (Watcom on WIN32) the .DEF files would need another 
translation step. But one suggestion for .DEF approach:

Unfortunately, there is a problem with .DEF files. They do not support
something like #ifdef. This means that we cannot conditionally declare 
symbol as exportable, depending on if a particular feature has been
enabled or not. If a .DEF file specifies a symbol which cannot be found 
any of the object files, the linker reports an 'unresolved external
symbol' error. If we use a .DEF file, then everything in
include/libxml/xmlversion.h must forever remain the same for 

I assume something can be done to this, even without using Perl a 
special macro processor. If MSVC hasn't dropped support for this, you 
use "cl /E" to preprocess your source only, writing to stdout.

So you can use a file libxml.c with all the EXPORT stuff but also 
including xmlversion.h and doing all the #ifdefs.


cl /E libxml2.c >libxml2.def

will generate the right .def file. Perhaps there's even a way to 
automatically execute this command from the IDE.

Peter Jacobi

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