You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by 曹煦 <ca...@lightpole.net> on 2009/06/02 08:43:25 UTC

[Fwd: need your help]


Re: [Fwd: need your help]

Posted by mbiggs <xe...@doubleplum.net>.
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:
>> 曹煦 <ca...@lightpole.net>
>> Date:
>> Tue, 02 Jun 2009 14:39:17 +0800
>> To:
>> c-users@xerces.apache.org
>> 
>> To:
>> c-users@xerces.apache.org
>> 
>> 
>> 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:
>> 
>> [root@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.
>> 
>
>

Re: [Fwd: need your help]

Posted by Alberto Massari <am...@datadirect.com>.
Your command line is missing the -lxerces-c switch

Alberto

曹煦 wrote:
>
>
> ------------------------------------------------------------------------
>
> Subject:
> need your help
> From:
> 曹煦 <ca...@lightpole.net>
> Date:
> Tue, 02 Jun 2009 14:39:17 +0800
> To:
> c-users@xerces.apache.org
>
> To:
> c-users@xerces.apache.org
>
>
> 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:
>
> [root@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.
>