[xml] Problem with MSYS and MINGW: undefined reference to _imp__xmlFree



Hi,

if found a problem when using the libxml library to build
opensync on Windows with MSYS and MINGW. I get errors described
below. I found some email thread from 2004 which describes the
same problem. I changed the xmlexports.h include file and then
I can compile. (See the #if 0 part). I do not know too enought
about building the library, so I cannot provide a full patch.

I reported the bug in: http://bugzilla.gnome.org/show_bug.cgi?id=561340

===== Extract from modified xmlexports.h file ==========

#if defined(_WIN32) && defined(__MINGW32__)
 #undef XMLPUBFUN
 #undef XMLPUBVAR
 #undef XMLCALL
 #undef XMLCDECL
#if 0
 #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
   #define XMLPUBFUN __declspec(dllexport)
   #define XMLPUBVAR __declspec(dllexport)
 #else
   #define XMLPUBFUN
   #if !defined(LIBXML_STATIC)
     #define XMLPUBVAR __declspec(dllimport) extern
   #else
     #define XMLPUBVAR extern
   #endif
 #endif
 #define XMLCALL __cdecl
 #define XMLCDECL __cdecl
#else
 #define XMLPUBFUN
 #define XMLPUBVAR
 #define XMLCALL __cdecl
 #define XMLCDECL __cdecl
#endif
 #if !defined _REENTRANT
   #define _REENTRANT
 #endif
#endif


========= Problem description =========================


Linking C shared library libopensync.dll
Creating library file: libopensync.dll.a
CMakeFiles/opensync.dir/format/opensync_time.obj: In function `osync_time_dstchange': f:/opensync/opensync/format/opensync_time.c:1149: undefined reference to `_imp__xmlFree' f:/opensync/opensync/format/opensync_time.c:1164: undefined reference to `_imp__xmlFree' CMakeFiles/opensync.dir/group/opensync_group.obj: In function `osync_group_load': f:/opensync/opensync/group/opensync_group.c:826: undefined reference to `_imp__xmlFree' CMakeFiles/opensync.dir/group/opensync_group.obj: In function `osync_group_is_uptodate': f:/opensync/opensync/group/opensync_group.c:1273: undefined reference to `_imp__xmlFree' CMakeFiles/opensync.dir/group/opensync_member.obj: In function `osync_member_parse_timeout': f:/opensync/opensync/group/opensync_member.c:89: undefined reference to `_imp__xmlFree' CMakeFiles/opensync.dir/group/opensync_member.obj:f:/opensync/opensync/group/opensync_member.c:556: more undefined references to `_imp__xmlFree' follow
collect2: ld returned 1 exit status
make[2]: *** [opensync/libopensync.dll] Error 1
make[1]: *** [opensync/CMakeFiles/opensync.dir/all] Error 2
make: *** [all] Error 2

Fritz FRITZ /f/build-opensync




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