473,799 Members | 2,761 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.h pp>
#include <iostream>

XERCES_CPP_NAME SPACE_USE

int main(int argc, char* argv[])
{

try
{
XMLPlatformUtil s::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
XMLPlatformUtil s::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::X MLUni::fgXerces cDefaultLocale'
DDAS_XML_Parser .o(.text+0x13a) : In function `main':
: undefined reference to
`xercesc_2_7::X MLPlatformUtils ::Initialize(ch ar const*, char const*,
xercesc_2_7::Pa nicHandler*, xercesc_2_7::Me moryManager*, bool)'
DDAS_XML_Parser .o(.text+0x17e) : In function `main':
: undefined reference to `xercesc_2_7::X MLPlatformUtils ::Terminate()'
DDAS_XML_Parser .o(.gcc_except_ table+0x10): undefined reference to
`typeinfo for xercesc_2_7::XM LException'
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 2654
On Oct 3, 4:56 am, mearvk <mea...@gmail.c omwrote:
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.c omwrote:
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.c omwrote:
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.c omwrote:
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.c omwrote:
>
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
2158
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 I saw a newsgroup message suggesting that the latest CVS version of Xerces was required for Studio 7.1, so I grabbed the source out of CVS using WinCVS and tried to compile again, and now it compiles completely, but fails when
2
4661
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 (XMLSpy4) but not with Xerces 2.6.0. I've included a really short and simple example to illustrate it. I would like to get some comments on the validation capabilities of Xerces 2.6.0. I though it *fully* supported W3C Schema!
4
5611
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 wrong. Could somebody help me? I didn't find any full example working on the net. Thank you for any hints! If I run the examples below, the parsers parses the file well, no vlaidation is occuring although the schema and xml file does not
0
1825
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 beta2-dom3-Xerces-J-bin.2.6 and added the following paths to my CLASSPATH: ..../xerces-2_6_2/xercesImpl.jar: ..../xerces-2_6_2/dom3-xercesImpl.jar: ..../xerces-2_6_2/dom3-xml-apis.jar: ..../xerces-2_6_2/xmlParserAPIs.jar: ..../xerces-2_6_2/xercesSamples.jar:
3
1956
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 C++ 2.7.0. Here are two XML Schemas:
3
3405
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 pre-98) without having to build the library from source? We posed this question to the Xerces-users email list, but have yet to
1
1817
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 prefer to re-compile the xerces code with icc compiler. So I would like to know if someone has experience of compiling the xerces c code with icc compiler? Are there any known issues that needs to be taken care of during compilation with icc?...
9
3021
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> <binaryobject3></binaryobject3>
1
2016
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 works.By the way,the location of JDK is:C:\Program Files\Java\jdk1.5.0_06; Then I install the parser to the follow location:C:\Program Files\Java\xerces-1_4_3, using this command right under the C drive. jar xf xerces-j-bin.1.4.3.zip This creates a...
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10485
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9073
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.