From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30089 invoked by alias); 24 Mar 2008 12:38:03 -0000 Received: (qmail 30078 invoked by uid 22791); 24 Mar 2008 12:38:02 -0000 X-Spam-Check-By: sourceware.org Received: from 210.18.76.166.sify.net (HELO in.niksun.com) (210.18.76.166) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 24 Mar 2008 12:37:44 +0000 Received: from in.niksun.com (unknown [10.60.3.164]) by in.niksun.com (Postfix) with ESMTP id 1A8055C9B for ; Mon, 24 Mar 2008 18:23:41 +0530 (IST) From: Harish To: gcc-help@gcc.gnu.org Subject: Problem with static library linking Date: Mon, 24 Mar 2008 12:38:00 -0000 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803241810.22902.harish@in.niksun.com> Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-03/txt/msg00239.txt.bz2 Hi, I am having a problem with the static library as explained below. There was an existing static library libpcap.a I created a new static library with the name mylib.a , mylib.a calls a function func() in libpcap.a. I created mylib.a using the below command ar rcs mylib.a *.o libpcap.a ranlib mylib.a mylib.a has been successfully made. But when I use mylib.a with an executable it says undefined symbol for the function func() in the file which is present in mylib.a. I used the command "nm mylib.a | grep func" to verify that mylib.a actually contains func(). But still I am getting linking error. In my link line libpcap.a comes before mylib.a Could you please help. I would be very thankful. -Harish