Re: [xml] MSYS and MINGW: undefined reference to _imp__xmlFree
- From: "Martin Schlemmer" <Martin Schlemmer nwu ac za>
- To: <xml gnome org>
- Subject: Re: [xml] MSYS and MINGW: undefined reference to _imp__xmlFree
- Date: Tue, 17 Nov 2009 13:14:35 +0200
On 2009/11/09 at 10:53 PM, Roumen Petrov <bugtrack roumenpetrov info> wrote:
Martin Schlemmer wrote:
On 11/8/2009 at 8:08 PM, Roumen Petrov <bugtrack roumenpetrov info> wrote:
Roumen Petrov wrote:
Martin Schlemmer wrote:
It seems to me Martin is right but proposed patch is not correct to me.
I think that code has to set LIBXML_STATIC internally when is compiled
for static library. As libxml build is libtool based we may use PIC
definition. libtool when compile source for shared always set -DPIC .
Idea was sort of to remove the need for that. I will respond to Igor's mail
Now with reverted commit
, i.e. restored "...defined(IN_LIBXML)..." plus following patch
diff --git a/libxml.h b/libxml.h
index 3c44c83..1656ac2 100644
@@ -90,4 +90,7 @@ void __xmlGlobalInitMutexDestroy(void);
+# define LIBXML_STATIC
#endif /* ! __XML_LIBXML_H__ */
This probably will break MSVC and Borland. Also non-libtool-enabled builds
might also break,
as "-fPIC -DPIC" is added by libtool, but ignored by gcc on win32 as all code
on x86-win32 is already
No ! -fPIC is not set for gcc mingw target by libtool !
For mingw target it is another definition that you already use in the
patch proposed by you : #if defined(DLL_EXPORT) .... i.e. libtool for
mingw target set -DDLL_EXPORT -DPIC. For gcc on linux it is -fPIC -DPIC
. For other compilers as example -kPIC -DPIC.
In brief one is compiler flag and another is common for all platforms -
it is C preprocessor flag -DPIC.
Never mind here - I missed that it was in an internal header, and thus would not
have effected external projects linking against libxml.
Not sure what to suggest with this, but to check that with reverted commit
that xmlsec is indeed
built with -DLIBXML_STATIC if linking to the static version of the library.
Don't mix preprocessor flags set by other projects when static linking
with libxml is required.
Like Igor pointed out, LIBXML_STATIC needs to be defined if you link against the
static version for the current setup. If using pkg-config for a static only build of
libxml, this is not an issue, but ...
Vrywaringsklousule / Disclaimer: http://www.nwu.ac.za/it/gov-man/disclaimer.html
] [Thread Prev