473,811 Members | 2,895 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_Directo ry

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

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_Directo ry
/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 2356
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.l earn.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
1157
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
7395
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 number of DLLs I have (because I'd like to keep my sanity). Is there some way to compile a managed C++ DLL into a C# DLL, or am I just stuck consolidating the managed C++ into a single DLL? Lee
10
2695
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 .NET2003. also, when I do not try to link the fortran library (just to see if that was the cause), it builds the exe without any problems. i don't even know how to begin addressing this problem...any help would be
8
2080
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 mylib.lib. That Lib as well as the EXE have MFC linked statically. Then in a completely different project I have a regular DLL, wich is compiled with the /CLR switch and therefore needs the special CRT libs as
3
4376
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 closely as possible, yet I'm getting odd linking errors. I think I've traced it to some kind of problem with the SDL libraries it uses, yet I can't explain why it will compile from the makefile and not from the IDE. I have made sure that the ide...
3
2393
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 does support import of some "extra" modules. I have made a few attempts but with limited success. In particular, I have tried things like adding -static to the compiler options in the Makefile. At one point I managed to build a python that was...
1
2365
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 want to link a shared library libxyz.so to my binary satically, so that i may not need that at run time. i used -staticlib=xyz but its not working . Its saying that CC: Warning: illegal option xyz ignored I included the path in PATH and...
36
3209
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 technical point of view, the linking method is important when it comes to licencing issues as some licences, like GPL, differ between those kinds of linking when it comes to viewing the library as a derivative work of the main program.
12
34445
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 the glibc version used for linking mongoose.c:3081: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
0
9607
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
10663
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...
1
10416
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10138
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...
1
7676
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
6897
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
5704
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3881
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3029
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.