[Bug 876264] Re: libmediastreamer.so and libortp.so are not properly linked
*** This bug is a duplicate of bug 825542 *** https://bugs.launchpad.net/bugs/825542 ** This bug has been marked a duplicate of bug 825542 Symbol generation/lookup broken -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/876264 Title: libmediastreamer.so and libortp.so are not properly linked To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linphone/+bug/876264/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 876264] Re: libmediastreamer.so and libortp.so are not properly linked
There is also a thread on ubuntuforums.org on this topic: http://ubuntuforums.org/showthread.php?t=1870939 For information: both libraries are in /usr/lib: /usr/lib$ ls libmediastreamer* libortp* libmediastreamer.so libmediastreamer.so.0 libmediastreamer.so.0.0.0 libortp.so libortp.so.8 libortp.so.8.0.0 and libmediastreamer.so depends on libortp.so: /usr/lib$ ldd libmediastreamer.so.0.0.0 | grep libortp libortp.so.8 = /usr/lib/libortp.so.8 (0x7f21646ed000) And libmediastreamer.so really demands ortp_malloc symbol: /usr/lib$ nm -D libmediastreamer.so.0.0.0 | grep malloc U malloc U ortp_malloc U ortp_malloc0 while libortp.so really exports ortp_malloc symbol: /usr/lib$ nm -D /usr/lib/libortp.so.8 | grep malloc U malloc 7ea0 T ortp_malloc 7ed0 T ortp_malloc0 However, the compiler (linker) still complains about: /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libmediastreamer.so: undefined reference to symbol 'ortp_malloc' /usr/bin/ld: note: 'ortp_malloc' is defined in DSO /usr/lib/libortp.so.8 so try adding it to the linker command line /usr/lib/libortp.so.8: could not read symbols: Invalid operation Any news? -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/876264 Title: libmediastreamer.so and libortp.so are not properly linked To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linphone/+bug/876264/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 876264] Re: libmediastreamer.so and libortp.so are not properly linked
Well, I finally succeeded to manage the problem. Below is how I did it, for further reference: 0. Even more first: here are the relevant links: http://lists.fedoraproject.org/piper...ch/133601.html https://fedoraproject.org/wiki/Featu...icitDSOLinking https://fedoraproject.org/wiki/Under...gDSOLinkChange There is a change in the default behavior of the linker, that now does not *implicitely* links with NEEDED libraries, but requires to pass those libraries in explicit manner. 1. First of all, I was building the software using scons and the original command line as passed by scons to the environment was: /build$ gcc -o program program.o -lm -lsndfile -lmediastreamer -lGL -lGLU -lglut -lIrrlicht -litpp libmsf_library.a libbas_library.a libtst_library.a /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libmediastreamer.so: undefined reference to symbol 'ortp_malloc' /usr/bin/ld: note: 'ortp_malloc' is defined in DSO /usr/lib/libortp.so.8 so try adding it to the linker command line /usr/lib/libortp.so.8: could not read symbols: Invalid operation collect2: ld returned 1 exit status The linker suggested /usr/bin/ld: note: 'ortp_malloc' is defined in DSO /usr/lib/libortp.so.8 so try adding it to the linker command line 2. However, if I added -lortp just after -lmediastreamer, it still complained (why? I cannot explain): /build$ gcc -o program program.o -lm -lsndfile -lmediastreamer -lortp -lGL -lGLU -lglut -lIrrlicht -litpp libmsf_library.a libbas_library.a libtst_library.a /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libmediastreamer.so: undefined reference to symbol 'ortp_malloc' /usr/bin/ld: note: 'ortp_malloc' is defined in DSO /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libortp.so so try adding it to the linker command line /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libortp.so: could not read symbols: Invalid operation collect2: ld returned 1 exit status 3. By hazard, I added the litigious -lortp last in the command line, after all the files: /build$ gcc -o program program.o -lm -lsndfile -lmediastreamer -lGL -lGLU -lglut -lIrrlicht -litpp libmsf_library.a libbas_library.a libtst_library.a -lortp libmsf_library.a(msf_sinker_glutdisplay.o): In function `glut_animate': /home/user/eclipse-workspace/program/msf_sinker_glutdisplay.c:18: undefined reference to `glutPostRedisplay' [...skipped...] collect2: ld returned 1 exit status So, now IT WORKED! I mean, it found the ortp_malloc symbol declared in the libortp.so library, but started complaining about not finding various glut, GLU and GL functions (although the libraries are plassed, but *before* the files). 4. Finally, I decided to move all libraries *at the end* of the command line: /build$ gcc -o program program.o libmsf_library.a libbas_library.a libtst_library.a -lortp -lm -lsndfile -lmediastreamer -lGL -lGLU -lglut -lIrrlicht -litpp and, now, the compilation went flawless. Now, the real question remains how to persuade scons to put libraries at the end, but that is outside this topic. I will mark this bug as invalid, since is not a problem with linphone, but with ld and with scons. Thanks for your attention. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/876264 Title: libmediastreamer.so and libortp.so are not properly linked To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linphone/+bug/876264/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 876264] Re: libmediastreamer.so and libortp.so are not properly linked
Well, how to mark it as invalid? -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/876264 Title: libmediastreamer.so and libortp.so are not properly linked To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linphone/+bug/876264/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 876264] Re: libmediastreamer.so and libortp.so are not properly linked
Well, the links above are: http://lists.fedoraproject.org/pipermail/devel/2010-March/133601.html https://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking https://fedoraproject.org/wiki/UnderstandingDSOLinkChange -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/876264 Title: libmediastreamer.so and libortp.so are not properly linked To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linphone/+bug/876264/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 876264] Re: libmediastreamer.so and libortp.so are not properly linked
-- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/876264 Title: libmediastreamer.so and libortp.so are not properly linked To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linphone/+bug/876264/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 876264] Re: libmediastreamer.so and libortp.so are not properly linked
Here is the content of file test.c (aka ring.c from mediastreamer tests directory): /* mediastreamer2 library - modular sound and video processing and streaming Copyright (C) 2006 Simon MORLAT (simon.mor...@linphone.org) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include mediastreamer-config.h #endif #include mediastreamer2/mediastream.h int main(int argc, char *argv[]){ RingStream *r; const char *file; MSSndCard *sc; const char * card_id=NULL; ortp_init(); ortp_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL); ms_init(); if (argc1){ file=argv[1]; }else file=/usr/share/sounds/linphone/rings/oldphone.wav; if (argc2){ card_id=argv[2]; } sc=ms_snd_card_manager_get_card(ms_snd_card_manager_get(),card_id); #ifdef __linux if (sc==NULL) sc = ms_alsa_card_new_custom(card_id, card_id); #endif r=ring_start(file,2000,sc); ms_sleep(10); ring_stop(r); return 0; } Compilation line is: gcc test.c -lmediastreamer with the errors: /usr/bin/ld: /tmp/ccBKxTjt.o: undefined reference to symbol 'ortp_init' /usr/bin/ld: note: 'ortp_init' is defined in DSO /usr/lib/libortp.so.8 so try adding it to the linker command line /usr/lib/libortp.so.8: could not read symbols: Invalid operation collect2: ld returned 1 exit status -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/876264 Title: libmediastreamer.so and libortp.so are not properly linked To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linphone/+bug/876264/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 876264] Re: libmediastreamer.so and libortp.so are not properly linked
attached source code ring.c for greater visibility. note compliation line: gcc ring.c -lmediastreamer The error is on Oneiric 64 bit, fresh installs, all updates. ** Attachment added: source code https://bugs.launchpad.net/ubuntu/+source/linphone/+bug/876264/+attachment/2554097/+files/ring.c -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/876264 Title: libmediastreamer.so and libortp.so are not properly linked To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linphone/+bug/876264/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs