Statically Linking Libraries

L

LinuxN00b

Hey,

I have a problem linking Xerces-c (Apache's XMLParser)
with my program.

Here is a copy of my makefile.

# CXX is for GNU make, CCC is for Solaris make # Define the default
compiler to use for C++ programs as u++
CXX=g++
#CXXFLAGS=-g
CCC=g++ # Define the default compiler to use for C++ programs as g++

all: Deflate_Directory

Deflate_Directory: XMLParser.o FileGen.o Main.o
$(CXX) XMLParser.o -lxerces-c_2 FileGen.o Main.o -o Deflate_Directory

XMLParser.o: XMLParser.h XMLParser.cpp
FileGen.o: XMLParser.h FileGen.h FileGen.cpp
Main.o: XMLParser.h FileGen.h Main.cpp

clean:
rm *.o


Here is the result from running make.

g++ XMLParser.o -lxerces-c_2 FileGen.o Main.o -o Deflate_Directory
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../../i686-pc-cygwin/bin/ld:
cannot fi
nd -lxerces-c_2
collect2: ld returned 1 exit status

I tried listing the actual directory it is located and tried copying
the lib file and the dll file into my local directory. It still
cannot link with this library.

How do I link with this library?

Thanks in advance.

Peace.

Ben Chan
 
T

Thomas Matthews

LinuxN00b said:
Hey,

I have a problem linking Xerces-c (Apache's XMLParser)
with my program. [...]

How do I link with this library?

Thanks in advance.

Peace.

Ben Chan

Linking is an implementation issue and best discussed
in a newsgroup about your compiler or operating system.
The C++ has no facilities or requirements for linking.
Your post is off-topic for this newsgroup.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top