On Tue, 2 Jun 2009, Alberto Massari wrote:
Your command line is missing the -lxerces-c switch

Perhaps this should be added to a FAQ or something on the Xerces website?

__
mbiggs


------------------------------------------------------------------------

Subject:
need your help
From:
?????? <[email protected]>
Date:
Tue, 02 Jun 2009 14:39:17 +0800
To:
[email protected]

To:
[email protected]


Hi evryone

I am a new user of xerces-c. After installed the xerces-c-3.0.1, I have run several samples successfully such as SAXCount. But the following error occured when I ran the example in the Programming Guide, which is :

#include <xercesc/util/PlatformUtils.hpp>
// Other include files, declarations, and non-Xerces-C++ initializations.

using namespace xercesc;

int main(int argc, char* argv[])
{
try {
  XMLPlatformUtils::Initialize();
}
catch (const XMLException& toCatch) {
  // Do your failure processing here
  return 1;
}

// Do your actual work with Xerces-C++ here.

XMLPlatformUtils::Terminate();

// Other terminations and cleanup.
return 0;
}

And the error info:

[r...@devbc main]# g++ -L /root/work/study/xerces-c-3.0.1 -o test test_xerces.cpp
/tmp/cc7k01eH.o: In function `main':
test_xerces.cpp:(.text+0x84): undefined reference to `xercesc_3_0::XMLUni::fgXercescDefaultLocale' test_xerces.cpp:(.text+0xa4): undefined reference to `xercesc_3_0::XMLPlatformUtils::Initialize(char const*, char const*, xercesc_3_0::PanicHandler*, xercesc_3_0::MemoryManager*)' test_xerces.cpp:(.text+0xbd): undefined reference to `xercesc_3_0::XMLPlatformUtils::Terminate()' /tmp/cc7k01eH.o:(.gcc_except_table+0x10): undefined reference to `typeinfo for xercesc_3_0::XMLException'
collect2: ld returned 1 exit status

What is the problem?
Appreticate your help.


Reply via email to