Ok I finally got it working. What I did is download the latest source version of 
xerces (2.4.0 I guess), build the library and recompile with this and it seems to be 
working on my simple example.
The only difference is that on the g++ command I have to use 
-I/usr/local/xerces/include, it somehow does not work with 
-I/usr/local/xerces/include/xercesc and #include <util/PlatformUtils.hpp>.

Anyway my program is compiling fine now. Thanks all for help.


#include <xercesc/util/PlatformUtils.hpp>
#include <string>
#include <iostream>

// To compile
// g++ -I/usr/include/xercesc testXML.c -lxerces-c -o testXML

using namespace xercesc;
using namespace std;

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;
        }

}


---------- Initial Header -----------

From      : "Adam Heinz" <[EMAIL PROTECTED]>
To          : <[EMAIL PROTECTED]>
Cc          : 
Date      : Thu, 15 Jan 2004 09:15:09 -0500
Subject : RE: Link problem on Red Hat 9

Instead of "using namespace xercesc", use the macro XERCES_CPP_NAMESPACE_USE, as the 
namespace is actually xercesc_2_4_0, or whatever version you're using.

Adam Heinz
Senior Software Developer
Exstream Software

-----Original Message-----
From: Peter Guyatt [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 5:24 AM
To: [EMAIL PROTECTED]
Subject: RE: Link problem on Red Hat 9


Hi There,

        Your missung the using namespace xercesc;

That should then compile.

Thanks

Pete

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



********** 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to