← Back to team overview

kicad-developers team mailing list archive

Re: Compiling fails on XML class on Apple OS X with wxWidgets 2.9-svn

 

On 08/11/2010 09:58 AM, Jerry Jacobs wrote:
> Dear all,
>
> I tried compiling the latest revision of wxWidget and KiCad on my 
> Macbook with Apple OS X and it failed on the XML library that Dick is 
> using now. I recompiled again and the option to enable the XML library 
> is the --enable-expat but still it fails. The weird thing is that there 
> are some function symbols in the static monolithic library in the 
> wxXmlDocument class. So that means it is enabled. Below there is my 
> wxWidgets configuration of configure and the error I get during linking. 
> Maybe some people have suggestions or ideas. The point is I want to test 
> the latest stuff and need to compile it myself then.
>
> Kind regards,
> Jerry Jacobs
> - http://www.xor-gate.org
>
> ./configure --enable-unicode=yes --enable-shared=no --enable-monolithic 
> --with-opengl   --enable-universal_binary --enable-aui --enable-debug 
> --with-osx_cocoa   --with-macosx-sdk=/Developer/SDKs/MacOSX10.5.sdk/ 
> --prefix=/opt/wxwidgets/rev-65251 --enable-expat
>
> Linking CXX executable eeschema.app/Contents/MacOS/eeschema
> Undefined symbols:
>    "_XML_SetCharacterDataHandler", referenced from:
>        wxXmlDocument::Load(wxInputStream&, wxString const&, int)in 
> libwx_osx_cocoau-2.9.a(monolib_xml.o)
>    "_XML_SetCommentHandler", referenced from:
>        wxXmlDocument::Load(wxInputStream&, wxString const&, int)in 
> libwx_osx_cocoau-2.9.a(monolib_xml.o)
>    "_XML_SetCdataSectionHandler", referenced from:
>        wxXmlDocument::Load(wxInputStream&, wxString const&, int)in 
> libwx_osx_cocoau-2.9.a(monolib_xml.o)
>    "_XML_SetUserData", referenced from:
>        wxXmlDocument::Load(wxInputStream&, wxString const&, int)in 
> libwx_osx_cocoau-2.9.a(monolib_xml.o)
>    "_XML_ParserFree", referenced from:
>        wxXmlDocument::Load(wxInputStream&, wxString const&, int)in 
> libwx_osx_cocoau-2.9.a(monolib_xml.o)
>    "_XML_ParserCreate", referenced from:
>        wxXmlDocument::Load(wxInputStream&, wxString const&, int)in 
> libwx_osx_cocoau-2.9.a(monolib_xml.o)
>    "_XML_SetElementHandler", referenced from:
>        wxXmlDocument::Load(wxInputStream&, wxString const&, int)in 
> libwx_osx_cocoau-2.9.a(monolib_xml.o)
>    "_XML_SetUnknownEncodingHandler", referenced from:
>        wxXmlDocument::Load(wxInputStream&, wxString const&, int)in 
> libwx_osx_cocoau-2.9.a(monolib_xml.o)
>    "_XML_GetErrorCode", referenced from:
>        wxXmlDocument::Load(wxInputStream&, wxString const&, int)in 
> libwx_osx_cocoau-2.9.a(monolib_xml.o)
>    "_XML_SetDefaultHandler", referenced from:
>        wxXmlDocument::Load(wxInputStream&, wxString const&, int)in 
> libwx_osx_cocoau-2.9.a(monolib_xml.o)
>    "_XML_Parse", referenced from:
>        wxXmlDocument::Load(wxInputStream&, wxString const&, int)in 
> libwx_osx_cocoau-2.9.a(monolib_xml.o)
>    "_XML_GetCurrentLineNumber", referenced from:
>        _StartCdataHnd in libwx_osx_cocoau-2.9.a(monolib_xml.o)
>        wxXmlDocument::Load(wxInputStream&, wxString const&, int)in 
> libwx_osx_cocoau-2.9.a(monolib_xml.o)
>        _CommentHnd in libwx_osx_cocoau-2.9.a(monolib_xml.o)
>        _TextHnd in libwx_osx_cocoau-2.9.a(monolib_xml.o)
>        _StartElementHnd in libwx_osx_cocoau-2.9.a(monolib_xml.o)
>    "_XML_ErrorString", referenced from:
>        wxXmlDocument::Load(wxInputStream&, wxString const&, int)in 
> libwx_osx_cocoau-2.9.a(monolib_xml.o)
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
> make[2]: *** [eeschema/eeschema.app/Contents/MacOS/eeschema] Error 1
> make[1]: *** [eeschema/CMakeFiles/eeschema.dir/all] Error 2
> make: *** [all] Error 2
>   

http://www.xml.com/pub/a/1999/09/expat/index.html?page=3

suggests these are expat symbols that are missing. 

Theoretically:

expat would or could be used in 1) static or 2) dynamic form.  And if
used statically (1) it could be linked in either a) to the wxWidgets
library or to your b) application.

1)
  a)
  b)
2)



On my linux machine it is linked in dynamically,

$ ldd /usr/lib/libwx_baseu_xml-2.8.so.0.6.0
    linux-vdso.so.1 =>  (0x00007fff381ed000)
    libz.so.1 => /lib/libz.so.1 (0x00007fba8a1ee000)
    libdl.so.2 => /lib/libdl.so.2 (0x00007fba89fea000)
    libwx_baseu-2.8.so.0 => /usr/lib/libwx_baseu-2.8.so.0
(0x00007fba89c92000)
    libexpat.so.1 => /lib/libexpat.so.1 (0x00007fba89a69000)
    libm.so.6 => /lib/libm.so.6 (0x00007fba897e6000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fba894d1000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007fba892ba000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x00007fba8909d000)
    libc.so.6 => /lib/libc.so.6 (0x00007fba88d19000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fba8a638000)

You can see the libexpat.so line.

and I have a package called expat installed:

$ dpkg -l | grep expat
ii  libexpat1                                 
2.0.1-7ubuntu1                                  XML parsing C library -
runtime library
ii  libexpat1-dev                             
2.0.1-7ubuntu1                                  XML parsing C library -
development kit
ii  libxml-sax-expat-perl                     
0.40-1                                          Perl module for a SAX2
driver for Expat (XML


It might be reasonable to assume there is some consistency in the build
mechanism within wxWidgets for the dynamic linking situation.





References