From: Yubin Ruan <ablacktshirt@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: Re: which object file is fstat64/stat64 located
Date: Mon, 17 Dec 2018 07:34:00 -0000 [thread overview]
Message-ID: <CAJYFCiO5MRsndg+um_x4JhjdBQkq_nDLGVVaqDE0FaT8tb1YVw@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1812170604430.22321@stedding.saclay.inria.fr>
On Mon, Dec 17, 2018 at 1:06 PM Marc Glisse <marc.glisse@inria.fr> wrote:
>
> 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?
I don't think so. They are all added at the very end.
Or, are you sure that fstat64/stat64 are located in libc.so ? Using
"nm -gC /usr/lib64/libc.so |grep fstat64" give no output.
--
Yubin
next prev parent reply other threads:[~2018-12-17 5:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-17 5:06 Yubin Ruan
2018-12-17 5:21 ` Marc Glisse
2018-12-17 7:34 ` Yubin Ruan [this message]
2018-12-17 20:51 ` Florian Weimer
2018-12-18 6:42 ` Yubin Ruan
2018-12-18 8:57 ` Florian Weimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJYFCiO5MRsndg+um_x4JhjdBQkq_nDLGVVaqDE0FaT8tb1YVw@mail.gmail.com \
--to=ablacktshirt@gmail.com \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).