473,396 Members | 1,866 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,396 software developers and data experts.

Statically Linking Libraries

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
Jul 19 '05 #1
1 2332
LinuxN00b wrote:
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

Jul 19 '05 #2

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

Similar topics

3
by: Jeff Stewart | last post by:
Is it possible, in VB.NET 2003 Standard, to link referenced DLLs statically, so I only have to distribute a single executable? -- Jeff S.
7
by: Lee Crabtree | last post by:
I'm starting work on what will eventually be a very, very LARGE project. A lot of the project involves taking C/C++ class libraries and wrapping them with managed C++. I'd like to minimize the...
10
by: Julian | last post by:
I get the following error when i try to link a fortran library to a c++ code in .NET 2005. LINK : fatal error LNK1104: cannot open file 'libc.lib' the code was working fine when built using...
8
by: bonk | last post by:
Is it generally OK for an EXE that has MFC linked statically to load an use another DLL wich has MFC linked as shared DLL ? To be more specific: I have an EXE that links a lib. Let's call it...
3
by: walkeraj | last post by:
I'm trying to compile an open source game called IVAN , and I'm able to compile it from a makefile, but not from an IDE. I have attempted to recreate the way the makefile compiles the project as...
3
by: Ralph Butler | last post by:
Hi: I have searched the docs and google but have not totally figured out how to accomplish my task: On a linux box, I want to compile and link python so that it uses no shared libraries, but...
1
by: ankur.cdac | last post by:
I have Sun WorkShop 6 update 1 C++ 5.2 2000/09/11 compiler running on SunOS 5.7 Generic_106541-08 sun4u sparc SUNW,Ultra-60 machine. i am using /opt/SUNWspro/bin//CC for building C++ code. I...
36
by: Martin Larsen | last post by:
Hi, When a PHP program links to a library using include or require (or their _once variations), is the library then linked dynamically or statically? While it might seem irrelevant from a...
12
by: tvnaidu | last post by:
I am getting this link error, I am using mongoose web server with Linux, any idea?: mongoose.c:3114: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.