This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
How to build a static library using another one?
- From: Long Li <long21st at yahoo dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 25 Jul 2002 17:28:38 -0700 (PDT)
- Subject: How to build a static library using another one?
Hi, Guys,
I am a newbie on making library in C & C++. I have
some c++ souce code files(a.cpp, b.cpp) and a C++
library(libutil.a) at hand. The c++ source code
files(a.cpp, b.cpp) use the functions of library
libtuil.a. I would like to build a single library
using them. This is what I tried:
I first compiled the source code files. Then I use
ar rc libcpp.a a.o b.o libutil.a
ranlib libcpp.a
It works fine. However, later when I used this library
in my other souce files, I got some compile error. It
seems the compiler found some undefined symbols in a.o
and b.o, those symbols happen to be the functions in
libtutil.a.
Could you tell me how to make it work?
Thanks a lot!
Long
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com