Menu

Troubles installing Xerces - beginner

Silvio
2007-09-07
2012-09-26
  • Silvio

    Silvio - 2007-09-07

    Hi,

    I'm quite a beginner when it comes to C++ and dev-C++ as well.
    I need to use a XML library for some project, and thus decided to use Xerces.

    I downloaded the sources from the web, and compiled them using Microsoft Visual C++, creating that way, a static/debug library: xerces-c_static_2D.lib.
    I then copied one of the samples of code given with the sources, and tested it.

    Of course, it didn't work.

    I added the directory with all the source files (.hpp and .cpp) in the "include directory" list.
    I also added as a parameter to the linker the path to the xerces-c_static_2D.lib file.

    The software is compiling. It's when linking that I get errors (a dozen of those):
    ...
    [Linker error] undefined reference to `_imp___ZN11xercesc_2_816XMLPlatformUtils10InitializeEPKcS2_PNS_12PanicHandlerEPNS_13MemoryManagerEb'
    ...

    After several hours, I found that :

    http://wiki.codesynthesis.com/Xerces_tips

    Saying you need to define something before computing.. I did it, but still get similar linking errors.
    (I know hardly anything of processor or preprocessor.. hum)

    I now get errors like this :
    ...
    [Linker error] undefined reference to `xercesc_2_8::XMLPlatformUtils::Initialize(char const, char const, xercesc_2_8::PanicHandler, xercesc_2_8::MemoryManager, bool)'
    ...

    I thought it was maybe not recognizing the library, but it happens that when the name of the library (given to the linker as an option) is not found, devcpp is giving an error.

    Is there something obvious I don't understand ?
    Do I have to add any particular directory in the "library directory" list ?

    Thanks a lot.

    PS : complete list of error.

    [Linker error] undefined reference to xercesc_2_8::XMLUni::fgXercescDefaultLocale' [Linker error] undefined reference toxercesc_2_8::XMLPlatformUtils::Initialize(char const, char const, xercesc_2_8::PanicHandler, xercesc_2_8::MemoryManager, bool)'
    [Linker error] undefined reference to xercesc_2_8::XMLString::transcode(wchar_t const*)' [Linker error] undefined reference toxercesc_2_8::XMLString::release(char)'
    [Linker error] undefined reference to xercesc_2_8::XMLPlatformUtils::Terminate()' [Linker error] undefined reference toxercesc_2_8::DOMImplementationRegistry::getDOMImplementation(wchar_t const
    )'
    [Linker error] undefined reference to xercesc_2_8::XMLPlatformUtils::fgMemoryManager' [Linker error] undefined reference toxercesc_2_8::XMLPlatformUtils::Terminate()'
    [Linker error] undefined reference to xercesc_2_8::XMLString::release(wchar_t**)' [Linker error] undefined reference toxercesc_2_8::XMLString::transcode(char const
    )'
    ld returned 1 exit status
    C:...\Makefile.win [Build Error] [Projet1.exe] Error 1

     
    • Wayne Keen

      Wayne Keen - 2007-09-07

      Out of curiosity, why do you beleive that a library compiled by and for Visual C++ is compatible with the GCC compiler? Generally speaking, that is a very bad assumption to make.

      Also, take a moment to check out the thread titled "Please Read Before Posting a Question" - in particular the section on the "Basic 3" - by excerpting the errors, and removing the information about how the cmpiler was invoked, you have thrown away a lot of information about how linking was done - which is what we need.

      There is also a section in there on the compile log, including headers and linking libraries that goes over some of the basics of the process for GCC.

      Wayne

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.