473,326 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Xerces Compilation Issue

Hello,

Let me preface this post by saying I'm new to C/C++ and to gcc/g++.
Now then, I'm trying to get Xerces (C++) working on a (64-bit) redhat
machine. The Xerces binaries were part of the Redhat distribition, and
are under /usr/lib64/httpd/.../xerces/ (Apache's stuff right?). Below
is the (simple) source file I am trying to compile:

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

XERCES_CPP_NAMESPACE_USE

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.

std::cout << "Hello, world!\n";
//Terminate DDAS_XML_Parser
XMLPlatformUtils::Terminate();

// Other terminations and cleanup.
return 0;
}
The following command runs without error:

$ g++ -Wall -c DDAS_XML_Parser.C -L/usr/lib64/httpd/modules/xerces/
xerces-c-redhat_AS4-gcc_343/lib -I/usr/lib64/httpd/modules/xerces/
xerces-c-redhat_AS4-gcc_343/include

Now I get the following errors when I try to compile this program as
an executable:

$ g++ -Wall DDAS_XML_Parser.o -o DDAS_XML_Parser

DDAS_XML_Parser.o(.text+0x135): In function `main':
: undefined reference to `xercesc_2_7::XMLUni::fgXercescDefaultLocale'
DDAS_XML_Parser.o(.text+0x13a): In function `main':
: undefined reference to
`xercesc_2_7::XMLPlatformUtils::Initialize(char const*, char const*,
xercesc_2_7::PanicHandler*, xercesc_2_7::MemoryManager*, bool)'
DDAS_XML_Parser.o(.text+0x17e): In function `main':
: undefined reference to `xercesc_2_7::XMLPlatformUtils::Terminate()'
DDAS_XML_Parser.o(.gcc_except_table+0x10): undefined reference to
`typeinfo for xercesc_2_7::XMLException'
collect2: ld returned 1 exit status

I have already defined the LD_LIBRARY_PATH to point to the location of
the ../lib folder which contains the .so files and the C_PLUS_INCLUDE
points to the ../include location. So the explicit command line
references are just making sure (in my mind) that g++ sees those
folders. But it's like the compiler doesn't see the .so files, even
though I think I'm telling it (twice) where it is.

Please let me know if I've left out any pertinent data needed for
diagnosis.

Help is greatly appreciated and thanks ahead of time,

Max

Oct 3 '07 #1
5 2628
On Oct 3, 4:56 am, mearvk <mea...@gmail.comwrote:
The following command runs without error:

$ g++ -Wall -c DDAS_XML_Parser.C -L/usr/lib64/httpd/modules/xerces/
xerces-c-redhat_AS4-gcc_343/lib -I/usr/lib64/httpd/modules/xerces/
xerces-c-redhat_AS4-gcc_343/include
(I've been away from *nix for a while but I'll try ...)
OK you've compiled your source into an object file. But library
paths (-L) are irrelevant at this stage.
Now I get the following errors when I try to compile this program as
an executable:
$ g++ -Wall DDAS_XML_Parser.o -o DDAS_XML_Parser
You're not compiling here - you're trying to link. This is
where the -L stuff should go, but you've set up an env var so that
shouldn't matter. BUT you're not specifying WHAT libraries to link:
try the -l (little ell) option.

HTH.

Oct 3 '07 #2
On Oct 3, 11:11 am, tragomaskhalos <dave.du.verg...@logicacmg.com>
wrote:
On Oct 3, 4:56 am, mearvk <mea...@gmail.comwrote:
The following command runs without error:
$ g++ -Wall -c DDAS_XML_Parser.C -L/usr/lib64/httpd/modules/xerces/
xerces-c-redhat_AS4-gcc_343/lib -I/usr/lib64/httpd/modules/xerces/
xerces-c-redhat_AS4-gcc_343/include

(I've been away from *nix for a while but I'll try ...)
OK you've compiled your source into an object file. But library
paths (-L) are irrelevant at this stage.
Now I get the following errors when I try to compile this program as
an executable:
$ g++ -Wall DDAS_XML_Parser.o -o DDAS_XML_Parser

You're not compiling here - you're trying to link. This is
where the -L stuff should go, but you've set up an env var so that
shouldn't matter. BUT you're not specifying WHAT libraries to link:
try the -l (little ell) option.

HTH.

I've tried the explicit -L and -I flags to link and nothing. Even did
a ldconfig -v and a ldconfig -p ../lib to no avail.

Any other ideas?

Thanks!

Oct 4 '07 #3
On Oct 4, 5:38 am, mearvk <mea...@gmail.comwrote:
On Oct 3, 11:11 am, tragomaskhalos <dave.du.verg...@logicacmg.com>
wrote:
You're not compiling here - you're trying to link. This is
where the -L stuff should go, but you've set up an env var so that
shouldn't matter. BUT you're not specifying WHAT libraries to link:
try the -l (little ell) option.

I've tried the explicit -L and -I flags to link and nothing. Even did
a ldconfig -v and a ldconfig -p ../lib to no avail.

Any other ideas?
1. Did you try my suggestion and research the -l (little ell)
option? This should do it for .a libraries, you may need
something else if xerces is a shared library.
2. Google "man g++" and "man gcc" and RT..M !!

Oct 4 '07 #4
On Oct 4, 5:42 am, tragomaskhalos <dave.du.verg...@logicacmg.com>
wrote:
On Oct 4, 5:38 am, mearvk <mea...@gmail.comwrote:
On Oct 3, 11:11 am, tragomaskhalos <dave.du.verg...@logicacmg.com>
wrote:
You're not compiling here - you're trying to link. This is
where the -L stuff should go, but you've set up an env var so that
shouldn't matter. BUT you're not specifying WHAT libraries to link:
try the -l (little ell) option.
I've tried the explicit -L and -I flags to link and nothing. Even did
a ldconfig -v and a ldconfig -p ../lib to no avail.
Any other ideas?

1. Did you try my suggestion and research the -l (little ell)
option? This should do it for .a libraries, you may need
something else if xerces is a shared library.
2. Google "man g++" and "man gcc" and RT..M !!
Yes I tried the -l option. Even if I'm in /usr/lib/ or lib64 all I get
when using -lxerces-c is that the versions that ld sees are all
incompatible.
Oct 4 '07 #5
On Oct 4, 6:27 pm, mearvk <mea...@gmail.comwrote:
>
Yes I tried the -l option. Even if I'm in /usr/lib/ or lib64 all I get
when using -lxerces-c is that the versions that ld sees are all
incompatible.- Hide quoted text -
In that case all I can suggest is try a newsgroup dedicated to
g++ / gcc - hopefully those guys will have seen this before.
Good luck.
Oct 5 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dan | last post by:
Help! I am trying to compile Xerces with Microsoft Visual Studio.Net 2003 (7.1). I tried first with the src zip, which had it's own set of compilation errors when I tried to compile, but then...
2
by: Olaf Meyer | last post by:
Apprentently xerces 2.6.0 (Java) does not validate against contraints specified in the schema (e.g. constraints specified via unique element). The validation works with the XML editor I'm using...
4
by: joes | last post by:
Hello there I tried for several days to get a simple validation with xml schema & xerces working. Goal for me is tuse JAXP and not specific Xerces classes. I don't get the point what I am doing...
0
by: Dale Gerdemann | last post by:
I've been trying to use DOM level 3 with xerces-2_6_2. There's a sample called samples/DOM3.java, but I've had trouble with compilation. I've downloaded Xerces-J-bin.2.6.2 and...
3
by: Nicolas | last post by:
Hi everybody, I'm stuck for a couple of days now to the following issue, concerning fixed/default attributes and multiple namespaces. Any help would be greatly appreciated... I'm using Xerces...
3
by: Matt | last post by:
Hello, Summary: Where can one download a Xerces-C (XML pardser) dynamic library file (.DLL file) for Windows (Win98/WinNT/Win2k/WinXP/Win2003, including server flavors; don't need to support...
1
by: Vijay Jain | last post by:
Hi All, We have a requirement to use icc compiler instead of existing gnu compiler. Though the icc compiler states that libraries compiled with gnu are compatible to use with icc. But we would...
9
by: mstilli | last post by:
Hi, I am trying to use schema for server side validation using xerces to catch the validation errors. validating this XML: <Content4> <textarea13></textarea13>...
1
by: Blocksom | last post by:
I am new to Java and XML and I am trying to solve a problem that has bothered for few days. I have download the parser Xerser-1.4.3 and jdk1.5.0_06I install the JDK first and test it, it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.