[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.
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: