LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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.

Notices



Reply
 
Search this Thread
Old 09-17-2009, 01:20 PM   #1
chaosless
LQ Newbie
 
Registered: Jul 2009
Location: Austin, Texas
Distribution: suse
Posts: 14

Rep: Reputation: 1
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?

Thanks,
/j

---

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. */
OUTPUT_FORMAT(elf32-i386)
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:

00000000 W stat
 
Old 09-17-2009, 01:33 PM   #2
chaosless
LQ Newbie
 
Registered: Jul 2009
Location: Austin, Texas
Distribution: suse
Posts: 14

Original Poster
Rep: Reputation: 1
well clearly it was my libraries - not checked what gcc does differently - but letting gcc build the libraries cleaned that up...

ar x ../libXXXX.a
gcc --shared -o ../libXXXX.so *.o

no longer get the complaint linking with my -lXXXX
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
symbol lookup error: /usr/lib/libavcodec.so.51: undefined symbol: av_crc04C11DB7 priceey Linux - Software 0 05-06-2009 09:14 AM
?cause of error? /usr/include/bits/stat.h field 'st_atim' has incomplete type maxreason Programming 2 08-17-2008 02:48 AM
symbol lookup error: /usr/lib/libgtk-x11.2.0.so.0: undefined symbol:... IamI Slackware 17 02-29-2008 12:10 PM
./firefox-bin: symbol lookup error: /usr/lib/libpango-1.0.so.0: undefined symbol: g_s cb8100 Slackware 3 10-05-2006 11:55 AM
Starting httpd: /usr/sbin/httpd: symbol lookup error: /usr/local/lib/libaprutil-0.so. bijuhpd Linux - Newbie 1 10-30-2005 06:07 PM


All times are GMT -5. The time now is 09:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration