From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 41102 invoked by alias); 17 Dec 2018 05:06:44 -0000 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 Received: (qmail 41088 invoked by uid 89); 17 Dec 2018 05:06:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:770, ruan, Ruan X-HELO: mail2-relais-roc.national.inria.fr Received: from mail2-relais-roc.national.inria.fr (HELO mail2-relais-roc.national.inria.fr) (192.134.164.83) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Dec 2018 05:06:42 +0000 Received: from 212-198-39-253.rev.numericable.fr (HELO stedding) ([212.198.39.253]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Dec 2018 06:06:40 +0100 Date: Mon, 17 Dec 2018 05:21:00 -0000 From: Marc Glisse Reply-To: gcc-help@gcc.gnu.org To: Yubin Ruan cc: gcc-help@gcc.gnu.org Subject: Re: which object file is fstat64/stat64 located In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-SW-Source: 2018-12/txt/msg00051.txt.bz2 On Mon, 17 Dec 2018, Yubin Ruan wrote: > I am seeking help here since I got error of "undefined reference to > fstat64/stat64" when linking without libstdc++ in a C++ program. I was > trying to use libcxx, so I added -nodefaultlibs when compiling the > program. To get necessary symbols from libc, I added -lc (and also > -lm -lgcc_s -lgcc). But I still got the undefined reference error. > > Note that I never use fstat64/stat64 in my program. I only use fstat/stat. > > From the man page[1] it is said that on Linux fstat/stat is a wrapper > around fstat64/stat64. So these two symbols must locate at some object > file I don't know. Could it be that you are using those -l* flags in the wrong order? -- Marc Glisse