LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-05-2011, 04:01 AM   #1
harishisnow
LQ Newbie
 
Registered: Nov 2010
Location: bangalore, india
Posts: 17

Rep: Reputation: 0
undefined reference to `__isoc99_sscanf'


Hello,

When I compile my code in Linux (ATCA machine), I am getting the following error:

/vobs/ims_do/lib/rhlinux/debug/libnem-dummy_td2.so: undefined reference to `__isoc99_sscanf'

The same code is being compiled in Solaris without any problems.
Please help me find a solution.

Regards,
Harish
 
Old 04-05-2011, 04:42 AM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by harishisnow View Post
...When I compile...
You think we here possess telepathic abilities here and know command line(s) you've used ?

A likely cause is that standard "C" library is missing, but if that's the case, the question is "why ?". I.e. typically linker know that it's needed.

Try to add '-lc' to your command line.
 
Old 04-05-2011, 11:25 AM   #3
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948
Quote:
Originally Posted by harishisnow View Post
/vobs/ims_do/lib/rhlinux/debug/libnem-dummy_td2.so: undefined reference to `__isoc99_sscanf'
You have glibc version prior to 2.7 installed, and are using libraries (ffmpeg?) which were compiled against glibc 2.7. The __isoc99_sscanf was added to glibc in version 2.7.

You'll need to check which static library file (*.a) refers to that symbol, and recompile it. You can use command
Code:
objdump -t path-to-library.a | grep -e __isoc99_sscanf
to find which library refers to that symbol.

Alternatively, you can upgrade your c library to version 2.7 or newer. If you're using Debian or Ubuntu, upgrading package libc6-dev to at least 2.7 should be enough.

If the error message referred to an unversioned symbol (i.e. the error message did not refer to __isoc99_sscanf@@GLIBC...), then you could write a __isoc99_sscanf wrapper using stdargs and GNU sscanf (their differences being usually insignificant) and include that in the linking.
 
1 members found this post helpful.
Old 07-27-2012, 12:45 PM   #4
noahzarc
LQ Newbie
 
Registered: Jul 2012
Posts: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by Nominal Animal View Post
You have glibc version prior to 2.7 installed, and are using libraries (ffmpeg?) which were compiled against glibc 2.7. The __isoc99_sscanf was added to glibc in version 2.7.

You'll need to check which static library file (*.a) refers to that symbol, and recompile it. You can use command
Code:
objdump -t path-to-library.a | grep -e __isoc99_sscanf
to find which library refers to that symbol.

Alternatively, you can upgrade your c library to version 2.7 or newer. If you're using Debian or Ubuntu, upgrading package libc6-dev to at least 2.7 should be enough.

If the error message referred to an unversioned symbol (i.e. the error message did not refer to __isoc99_sscanf@@GLIBC...), then you could write a __isoc99_sscanf wrapper using stdargs and GNU sscanf (their differences being usually insignificant) and include that in the linking.
Could you give out some hints about "__isoc99_sscanf wrapper using stdargs and GNU sscanf"?

Thanks!
 
Old 07-31-2012, 09:24 AM   #5
Metal-forth
LQ Newbie
 
Registered: Jul 2012
Posts: 1

Rep: Reputation: Disabled
Hi guys
New one here..
I am also having the same problem installing Nagios Plugins..


ssl -lcrypto -lpthread -ldl
libtool: link: gcc -DNP_VERSION=\"1.4.16\" -g -O2 -o check_http check_http.o sslutils.o netutils.o utils.o -L/root/downloads/nagios-plugins-1.4.16/plugins -L/usr/local/ssl/lib ../lib/libnagiosplug.a ../gl/libgnu.a -lnsl -lresolv -lssl -lcrypto -lpthread -ldl
/usr/local/ssl/lib/libcrypto.a(v3_utl.o): In function `ipv6_cb':
v3_utl.c.text+0x2d9): undefined reference to `__isoc99_sscanf'
/usr/local/ssl/lib/libcrypto.a(v3_utl.o): In function `a2i_ipadd':
v3_utl.c.text+0x125d): undefined reference to `__isoc99_sscanf'
/usr/local/ssl/lib/libcrypto.a(v3_utl.o): In function `a2i_IPADDRESS':
v3_utl.c.text+0x135f): undefined reference to `__isoc99_sscanf'
/usr/local/ssl/lib/libcrypto.a(v3_utl.o): In function `a2i_IPADDRESS_NC':
v3_utl.c.text+0x19df): undefined reference to `__isoc99_sscanf'
v3_utl.c.text+0x1a77): undefined reference to `__isoc99_sscanf'
collect2: ld returned 1 exit status
make[1]: *** [check_http] Error 1
make[1]: Leaving directory `/root/downloads/nagios-plugins-1.4.16/plugins'
make: *** [install-recursive] Error 1


Any ideas similar ideas??
 
Old 04-07-2015, 04:38 AM   #6
MadanKumarNath
LQ Newbie
 
Registered: Apr 2015
Posts: 1

Rep: Reputation: Disabled
undefined reference to `__isoc99_fscanf'

Use -D_GNU_SOURCE to compile. It will resolve the issue.

Thanks
Madan
 
  


Reply



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
Yet another undefined reference CollieJim Linux - General 2 12-17-2010 11:08 PM
Undefined reference, why? george_mercury Programming 4 05-07-2009 12:15 AM
Undefined reference to: ashlesha Programming 5 11-08-2006 01:07 PM
undefined reference? Sharky01252 Programming 3 11-07-2006 11:36 AM
undefined reference vkmgeek Programming 1 05-11-2006 06:37 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:54 AM.

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
Open Source Consulting | Domain Registration