From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13934 invoked by alias); 10 Feb 2006 21:04:10 -0000 Received: (qmail 13926 invoked by uid 22791); 10 Feb 2006 21:04:10 -0000 X-Spam-Check-By: sourceware.org Received: from smtp3.hushmail.com (HELO smtp3.hushmail.com) (65.39.178.135) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 10 Feb 2006 21:04:09 +0000 Received: from smtp3.hushmail.com (localhost.hushmail.com [127.0.0.1]) by smtp3.hushmail.com (Postfix) with SMTP id 2687DA32F1 for ; Fri, 10 Feb 2006 13:04:07 -0800 (PST) Received: from mailserver3.hushmail.com (mailserver3.hushmail.com [65.39.178.20]) by smtp3.hushmail.com (Postfix) with ESMTP for ; Fri, 10 Feb 2006 13:04:06 -0800 (PST) Received: (from nobody@localhost) by mailserver3.hushmail.com (8.12.11/8.12.9/Submit) id k1AL46GL004045 for ; Fri, 10 Feb 2006 16:04:06 -0500 (GMT) (envelope-from securehell@hushmail.com) Message-Id: <200602102104.k1AL46GL004045@mailserver3.hushmail.com> Date: Fri, 10 Feb 2006 21:04:00 -0000 To: Cc: Subject: Trouble inlining code From: X-IsSubscribed: yes 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 X-SW-Source: 2006-02/txt/msg00093.txt.bz2 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello group, I am trying to inline a function with gcc-3.4.4 on a linux x86_64 platform. The function I am trying to inline is in a header file: foo.h: inline int *your_func(int *a) { if (!a) return (NULL); return (*a++);} Any file that I compile that includes this header and code compiles without error: gcc -m64 -c -Wall -Winline -fPIC -O3 -o bar.o bar.c But when I try to link, I get a mess... /usr/bin/gcc -shared -Wl,--whole-archive -Wall -Winline -fPIC -o libfiles.so file.o libfoo.a -Wl,--no-whole-archive libfoo.a(file.o)(.text+0x0): In function `my_func': : multiple definition of `your_func' libfoo.a(bar.o)(.text+0x0): first defined here What could I be missing that will inline this function for me? Thanks, SH -----BEGIN PGP SIGNATURE----- Note: This signature can be verified at https://www.hushtools.com/verify Version: Hush 2.4 wkYEARECAAYFAkPs/8EACgkQRBFe1uc9INoi7gCaAkhb9S5rcYWmyEwmvK34mILqH1UA oJmf9uXEUpXxMYmIYoil2WrYz246 =wiWt -----END PGP SIGNATURE-----