[SOLVED] gcc linker error - hidden symbol `stat' in /usr/lib/libc_nonshared.a(stat.oS)
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
gcc linker error - hidden symbol `stat' in /usr/lib/libc_nonshared.a(stat.oS)
Am getting this linker error from gcc on linux:
hidden symbol `stat' in /usr/lib/libc_nonshared.a(stat.oS) is referenced by DSO
The complaint is from my library, all objects rebuilt by v4.3.2 gcc and g++. And yes some of the routines do call stat()
apologies if this is a compiler/linker option that i've missed but am able to link on opensolaris and other platforms just fine, so wondered if is a linux-gcc issue that might already be answered here?
i've tried a few options building my DSO... including -shared but it seems like stat() is a weak symbol that does not resolve?
here's some details if that helps...
ld --version == 2.19.1
/usr/lib/libc.so is actually this linker script:
/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld-linux.so.2 ) )
/lib/libc.so.6 is symbolic link to /lib/libc-2.9.so
readelf -s /lib/libc-2.9.so doesn't show stat() exported
/usr/lib/libc_nonshared.a (also in /usr/lib/libc.a) defines stat as a weak symbol: