You should look at the generated Xerces Makefile and at file Makefile.incl
for clues on how to link against the Xerces library, since the sample
applications shipped with the distribution do just that.  Those files are
in the src directory in the full source distribution.

Dave



                                                                                       
                                                        
                      xerces-c-dev-return-8838-David_N_Bertoni=lotus.com@xml           
                                                        
                      .apache.org                                                    
To:      XercesMailingList <[EMAIL PROTECTED]>  
                                                                                     
cc:      (bcc: David N Bertoni/CAM/Lotus)                 
                      10/23/2001 05:28 AM                                            
Subject: Newbie: undefined references when initializing   
                      Please respond to xerces-c-dev                                   
                                                        
                                                                                       
                                                        
                                                                                       
                                                        



I'm having trouble getting Xerces 1.5.1 to work (am using RH Linux 6.2).
Downloaded the source and followed the build instructions, but get these
compiler messages when trying to make the initialize call:

-----
(from TServer.cc)

  try
    {
      XMLPlatformUtils::Initialize();
    }
  catch(const XMLException &toCatch)
    {
      cout << "boot_db: error";
    }


g++ -g -o mymud main.o TServer.o TDesc.o
TServer.o: In function 'TServer::boot_db(void)':
/home/pos/mymud/TServer.cc:61: undefined reference to
'XMLPlatformUtils::Initialize(void)'
/home/pos/mymud/TServer.cc:63: undefined reference to 'XMLException
type_info
function'
collect2: ld returned 1 exit status
make: *** [mymud] Error 1

-----

The environment variables XERCESCROOT and LD_LIBRARY_PATH are set, and the
header files util/PlatformUtils.hpp and dom/DOM.hpp are included, so
perhaps
the problem is in the Makefile:

-----

(from Makefile)

obj = main.o TServer.o TDesc.o

mymud :            $(obj)
             g++ -g -o mymud $(obj)

main.o :           main.cc
                         g++ -g -c main.cc

TServer.o :              TServer.cc TServer.h
                         g++ -I/home/pos/xerces-c-src1_5_1/src/ -g -c
TServer.cc

TDesc.o :          TDesc.cc TDesc.h
                         g++ -g -c TDesc.cc

clean :
                         rm mymud $(obj)

-----

The compiler does find the two relevant header files because of the ?I
switch
(if the line is left out, two "no such file"-messages appear), so that's
not
it. Also, I've verified the spelling by looking in util/PlatformUtils.hpp,
but
that wasn't it either.

I'm just getting into Linux so the answer is probably really simple, but
any
help is appreciated a lot.

Best regards,
Henrik Jensen


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






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

Reply via email to