LinuxQuestions.org
Help answer threads with 0 replies.
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 07-31-2008, 10:07 PM   #1
darleys
LQ Newbie
 
Registered: Jul 2008
Posts: 9

Rep: Reputation: 0
undefined reference to `dlsym'


When I do a make , while building asterisk 1.4 I get this error
Quote:
[AR] hash/hash.o hash/hash_bigkey.o hash/hash_buf.o hash/hash_func.o hash/hash_log2.o hash/hash_page.o hash/ndbm.o btree/bt_close.o btree/bt_conv.o btree/bt_debug.o btree/bt_delete.o btree/bt_get.o btree/bt_open.o btree/bt_overflow.o btree/bt_page.o btree/bt_put.o bt ree/bt_search.o btree/bt_seq.o btree/bt_split.o btree/bt_utils.o db/db.o mpool/mpool.o recno/rec_close.o recno/rec_delete.o recno/rec_g et.o recno/rec_open.o recno/rec_put.o recno/rec_search.o recno/rec_seq.o recno/rec_utils.o -> libdb1.a
[LD] abstract_jb.o acl.o aescrypt.o aeskey.o aestab.o alaw.o app.o ast_expr2.o ast_expr2f.o asterisk.o astmm.o astobj2.o audiohook.o autoservice.o callerid.o cdr.o channel.o chanvars.o cli.o config.o cryptostub.o db.o devicestate.o dial.o dns.o dnsmgr.o dsp.o enum.o file.o fixedjitterbuf.o frame.o fskmodem.o global_datastores.o http.o image.o indications.o io.o jitterbuf.o loader.o logger.o manager. o md5.o netsock.o pbx.o plc.o privacy.o rtp.o say.o sched.o sha1.o slinfactory.o srv.o stdtime/localtime.o strcompat.o tdd.o term.o thr eadstorage.o translate.o udptl.o ulaw.o utils.o editline/libedit.a db1-ast/libdb1.a ../apps/modules.link ../cdr/modules.link ../channel s/modules.link ../codecs/modules.link ../formats/modules.link ../funcs/modules.link ../pbx/modules.link ../res/modules.link -> asterisk
loader.o: In function `load_dynamic_module':
/usr/src/asterisk/main/loader.c:362: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
asterisk.o: In function `main':
/usr/src/asterisk/main/asterisk.c:2828: warning: Using 'initgroups' in statically linked applications requires at runtime the shared li braries from the glibc version used for linking
asterisk.o: In function `ast_makesocket':
/usr/src/asterisk/main/asterisk.c:1089: warning: Using 'getgrnam' in statically linked applications requires at runtime the shared libr aries from the glibc version used for linking
editline/libedit.a(readline.o_a): In function `username_completion_function':
/usr/src/asterisk/main/editline/readline.c:1296: warning: Using 'getpwent' in statically linked applications requires at runtime the sh ared libraries from the glibc version used for linking
asterisk.o: In function `ast_makesocket':
/usr/src/asterisk/main/asterisk.c:1080: warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libr aries from the glibc version used for linking
editline/libedit.a(readline.o_a): In function `username_completion_function':
/usr/src/asterisk/main/editline/readline.c:1294: warning: Using 'setpwent' in statically linked applications requires at runtime the sh ared libraries from the glibc version used for linking
/usr/src/asterisk/main/editline/readline.c:1300: warning: Using 'endpwent' in statically linked applications requires at runtime the sh ared libraries from the glibc version used for linking
utils.o: In function `ast_gethostbyname':
/usr/src/asterisk/main/utils.c:223: warning: Using 'gethostbyname_r' in statically linked applications requires at runtime the shared l ibraries from the glibc version used for linking
manager.o: In function `accept_thread':
/usr/src/asterisk/main/manager.c:2406: warning: Using 'getprotobyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
(.text+0x2d6): undefined reference to `dlsym'
/usr/lib/gcc/i486-linux-gnu/4.2.3/../../../../lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
(.text+0x446): undefined reference to `dlsym'
collect2: ld returned 1 exit status
make[1]: *** [asterisk] Error 1
make: *** [main] Error 2
I don't know , How to fix it
 
Old 08-01-2008, 11:15 AM   #2
comprookie2000
Gentoo Developer
 
Registered: Feb 2004
Location: Fort Lauderdale FL.
Distribution: Gentoo
Posts: 3,291
Blog Entries: 5

Rep: Reputation: 58
What distro?
 
Old 08-01-2008, 02:03 PM   #3
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
maybe it helps to install
libcxxtools-dev + libcxxtools
 
Old 08-03-2008, 06:30 PM   #4
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Who's program is it? They need to add -ldl to the linker line, for one. In general, it seems that all of the warnings state that certain parts of glibc can't be statically linked on your system. Who's choice was it to link statically? If it was yours, try again using the default configuration. If not, ask someone at the project why they need to statically link.

On a side note, normally the first place to ask for this sort of help would be the developer. We can try to help, but they know their code best and it might be a bug that they need to fix.
ta0kira
 
Old 08-03-2008, 11:49 PM   #5
darleys
LQ Newbie
 
Registered: Jul 2008
Posts: 9

Original Poster
Rep: Reputation: 0
Its a open source PBX

Actually I tried to get resolved in their forum, but didn't get much help. Actually this seems to be a generic error, thats why I posted it here.
I tried to use LD_FLAGS=-ldl ./configure and did make, but got the same error.
How to check whether glibc is correctly compiled in my system is there any way to do it?
and I I need to statically link the libs , how to do it for this purpose...
 
Old 08-04-2008, 12:32 AM   #6
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
I'd email the developers directly. If it doesn't get resolved, I'd look for another project. "Open-source" doesn't mean "troubleshoot project shortcomings," after all. If it's a non-standard build, please let us know, otherwise I think you need to knock down the door of the developers. As a developer myself, I'd much rather someone with problems emailed me directly.
ta0kira

PS You rarely need to recompile glibc, and in fact it is only rarely compiled incorrectly in an established distro. Generally the project is considered in the wrong unless they require specific features of glibc dependent on specific versions, but that's what autoconf is supposed to take care of (i.e. ./configure.) Also, try placing the word export before LD_FLAGS=-ldl ./configure, but make sure you make distclean first.

Last edited by ta0kira; 08-04-2008 at 12:36 AM.
 
Old 08-04-2008, 08:19 PM   #7
darleys
LQ Newbie
 
Registered: Jul 2008
Posts: 9

Original Poster
Rep: Reputation: 0
It failed again

ta0kira , I tried the steps what you mentioned, when I did an export before LD_FLAGS=-ldl ./configure , it shows "bash: export: `./configure': not a valid identifier"
Actually I got the stable version of this software, and this one is the latest version. I got the older version which works without any issues.
http://www.asterisk.org/ . http://forums.digium.com.
I have been trying to resolve it for the past 5 days but not able to do it. I'm just wondering is it a issues with i386 / i686 version of glibc which gets messed up when I compile this software?
 
Old 08-05-2008, 01:19 PM   #8
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Sorry, I was a bit hasty. Place a ; between the export statement and ./configure.
ta0kira
 
Old 08-12-2008, 10:18 AM   #9
91change
Member
 
Registered: Jul 2008
Posts: 42

Rep: Reputation: 15
Smile similar problem

I faced similar problem with compiling ntpd under arm platform . I hope below information may help you .

This is not a solution and is only a workaround .



In my case , i don't need any crypting job . So i excluded the library while configuring .

You can do this omission ,by looking into configure file .
In ntpd . I changed the line below

********************************************************
*) # Look for libcrypto.a and libssl.a:
for i in $ans no
do
case "$host" in
*-*-darwin*)
test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break
;;
*)
test -f $i/libcrypto.so -a -f $i/libssl.so && break
test -f $i/libcrypto.a -a -f $i/libssl.a && break
;;
esac
done
case "$i" in
no)
ans=no
OPENSSL_LIB=
;;
*) ans=no
OPENSSL_LIB=

;;
esac
***************************************************

Look into the configure file in ntp package . I have changd lines in red . So configure wont be able to find it and wont compile th cryptlibrary .. .
 
Old 08-13-2008, 12:25 AM   #10
darleys
LQ Newbie
 
Registered: Jul 2008
Posts: 9

Original Poster
Rep: Reputation: 0
No Fix But Fixed

Thank you 91change , ta0kira and j-ray.
Actually I did a make without "make menuselect" and built it without additional components (which is not good).
but atleast, I'm able to install the default package. Now its bit hard for me to enable few features in that application. But will try to get those resolved with the developers itself.

Thank you...
 
  


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
undefined reference to dlopen, dlclose, dlsym and dlerror patrickdepingui Slackware 5 02-14-2010 08:55 AM
Undefined reference, why? george_mercury Programming 4 05-07-2009 12:15 AM
undefined reference to.... crapodino Programming 1 01-13-2008 07:05 PM
undefined reference to `dlsym' bahadur Programming 10 05-12-2007 04:23 PM
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 08:39 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
Open Source Consulting | Domain Registration