You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Steel Bash <st...@chez.com> on 2004/01/15 11:21:16 UTC

Link problem on Red Hat 9

Hi all,

I'm moving my application from red hat 7.2 to red hat 9 and I'm facing probleme to get it compiled.

Here is the code

#include <util/PlatformUtils.hpp>

int main(int argc, char * argv[])
{
	//std::string str="Trying to compile some XML stuff";
	//std::cout << str << std::endl;
	// Initialize the XML4C2 system
	try
	{
		xercesc::XMLPlatformUtils::Initialize();
	}
	catch (const xercesc::XMLException & toCatch)
	{
		//std::cout << "Got an error" << std::endl;
	}
}

Here is how I try to compile it
g++ -I/usr/include/xercesc testXML.C -lxerces-c -o testXML

I've installed xercesc 2.2.0 (rpm version)
% rpm -qa | grep xerces
xerces-c-devel-2.2.0-2
xerces-c-2.2.0-2

The library is in /usr/lib and available to the linker
% grep xerces /etc/ld.so.cache
Binary file /etc/ld.so.cache matches

Here are the the errors when compiling (in fact this is the linking that makes problems.)
%g++ -I/usr/include/xercesc testXML.c -lxercesc -o testXML
/tmp/ccmHwbd8.o(.text+0x14): In function `main':
: undefined reference to `xercesc_2_2::XMLUni::fgXercescDefaultLocale'
/tmp/ccmHwbd8.o(.text+0x19): In function `main':
: undefined reference to `xercesc_2_2::XMLPlatformUtils::Initialize(char
const*)'
/tmp/ccmHwbd8.o(.gcc_except_table+0x10): undefined reference to `typeinfo for
xercesc_2_2::XMLException'
collect2: ld returned 1 exit status

I don't quite understand what's going on. Any hint to solve that ?
Thanks

Steel

********** PROTEGEZ VOS E-MAILS !********** 
Avec Tiscali SuperMail, vos e-mails en toute sécurité ! 
Anti Spam personnalisable 
Anti Virus actualisé en permanence 
et de nombreux bonus... 
Pour en savoir plus, rendez-vous sur http://www.tiscali.fr/supermail/



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Link problem on Red Hat 9

Posted by Alberto Massari <am...@progress.com>.
At 11.21 15/01/2004 +0100, Steel Bash wrote:
>Hi all,
>
>I'm moving my application from red hat 7.2 to red hat 9 and I'm facing 
>probleme to get it compiled.
>
>[...]
>Here is how I try to compile it
>g++ -I/usr/include/xercesc testXML.C -lxerces-c -o testXML

Shouldn't you use also -L/usr/lib/xercesc (use the path where xerces-c.so 
is found)?

Alberto


>I've installed xercesc 2.2.0 (rpm version)
>% rpm -qa | grep xerces
>xerces-c-devel-2.2.0-2
>xerces-c-2.2.0-2
>
>The library is in /usr/lib and available to the linker
>% grep xerces /etc/ld.so.cache
>Binary file /etc/ld.so.cache matches
>
>Here are the the errors when compiling (in fact this is the linking that 
>makes problems.)
>%g++ -I/usr/include/xercesc testXML.c -lxercesc -o testXML
>/tmp/ccmHwbd8.o(.text+0x14): In function `main':
>: undefined reference to `xercesc_2_2::XMLUni::fgXercescDefaultLocale'
>/tmp/ccmHwbd8.o(.text+0x19): In function `main':
>: undefined reference to `xercesc_2_2::XMLPlatformUtils::Initialize(char
>const*)'
>/tmp/ccmHwbd8.o(.gcc_except_table+0x10): undefined reference to `typeinfo for
>xercesc_2_2::XMLException'
>collect2: ld returned 1 exit status
>
>I don't quite understand what's going on. Any hint to solve that ?
>Thanks
>
>Steel ********** PROTEGEZ VOS E-MAILS !********** Avec Tiscali SuperMail, 
>vos e-mails en toute sécurité ! Anti Spam personnalisable Anti Virus 
>actualisé en permanence et de nombreux bonus... Pour en savoir plus, 
>rendez-vous sur http://www.tiscali.fr/supermail/
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


RE: Link problem on Red Hat 9

Posted by Peter Guyatt <pg...@telesoft-technologies.com>.
Hi There,

	Your missung the using namespace xercesc;

That should then compile.

Thanks

Pete

-----Original Message-----
From: Steel Bash [mailto:steelbash@chez.com]
Sent: 15 January 2004 10:21
To: xerces-c-dev
Subject: Link problem on Red Hat 9


Hi all,

I'm moving my application from red hat 7.2 to red hat 9 and I'm facing
probleme to get it compiled.

Here is the code

#include <util/PlatformUtils.hpp>

int main(int argc, char * argv[])
{
	//std::string str="Trying to compile some XML stuff";
	//std::cout << str << std::endl;
	// Initialize the XML4C2 system
	try
	{
		xercesc::XMLPlatformUtils::Initialize();
	}
	catch (const xercesc::XMLException & toCatch)
	{
		//std::cout << "Got an error" << std::endl;
	}
}

Here is how I try to compile it
g++ -I/usr/include/xercesc testXML.C -lxerces-c -o testXML

I've installed xercesc 2.2.0 (rpm version)
% rpm -qa | grep xerces
xerces-c-devel-2.2.0-2
xerces-c-2.2.0-2

The library is in /usr/lib and available to the linker
% grep xerces /etc/ld.so.cache
Binary file /etc/ld.so.cache matches

Here are the the errors when compiling (in fact this is the linking that
makes problems.)
%g++ -I/usr/include/xercesc testXML.c -lxercesc -o testXML
/tmp/ccmHwbd8.o(.text+0x14): In function `main':
: undefined reference to `xercesc_2_2::XMLUni::fgXercescDefaultLocale'
/tmp/ccmHwbd8.o(.text+0x19): In function `main':
: undefined reference to `xercesc_2_2::XMLPlatformUtils::Initialize(char
const*)'
/tmp/ccmHwbd8.o(.gcc_except_table+0x10): undefined reference to `typeinfo
for
xercesc_2_2::XMLException'
collect2: ld returned 1 exit status

I don't quite understand what's going on. Any hint to solve that ?
Thanks

Steel

********** PROTEGEZ VOS E-MAILS !**********
Avec Tiscali SuperMail, vos e-mails en toute sécurité !
Anti Spam personnalisable
Anti Virus actualisé en permanence
et de nombreux bonus...
Pour en savoir plus, rendez-vous sur http://www.tiscali.fr/supermail/



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org