dimanche 31 juillet 2016

How do I build a delay-loaded libxml2 implementation without a xmlFree error?

So building off my last question, I'm receiving the error message:

LINK : fatal error LNK1194: cannot delay-load 'libxml2.dll' due to import of data symbol '__imp__xmlFree'; link without /DELAYLOAD:libxml2.dll

Which is, to my understanding, happening because libxml2 defines and undefines xmlFree:

globals.h
XMLPUBVAR xmlFreeFunc xmlFree;
#undef  xmlFree

...

xmlFreeFunc xmlFree;

#ifdef LIBXML_THREAD_ENABLED
XMLPUBFUN  xmlFreeFunc * XMLCALL __xmlFree(void);
#define xmlFree 
(*(__xmlFree()))
#else
XMLPUBVAR xmlFreeFunc xmlFree;
#endif

How do I fix my code so that I can delay-load libxml2 while still deallocating memory (if I comment out just the xmlFree line, my code works fine)?

Aucun commentaire:

Enregistrer un commentaire