From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21913 invoked by alias); 26 Jul 2002 00:28:39 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 21906 invoked from network); 26 Jul 2002 00:28:38 -0000 Received: from unknown (HELO web14405.mail.yahoo.com) (216.136.174.62) by sources.redhat.com with SMTP; 26 Jul 2002 00:28:38 -0000 Message-ID: <20020726002838.17223.qmail@web14405.mail.yahoo.com> Received: from [157.165.41.125] by web14405.mail.yahoo.com via HTTP; Thu, 25 Jul 2002 17:28:38 PDT Date: Thu, 25 Jul 2002 17:28:00 -0000 From: Long Li Subject: How to build a static library using another one? To: gcc-help@gcc.gnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-07/txt/msg00253.txt.bz2 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