Re: weird problem with c++ libraries and symbols

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/29/2011 02:54 PM, Jonathan Wakely wrote:
> On 29 September 2011 13:28, Ottavio Campana wrote:
>>
>> I am facing a weird problem with a c++ library and after having googled
>> for a while I'm asking here for a suggestion.
> 
> You might get better answers if you provide the compiler and linker
> commands you're using to create the shared libraries and (some of) the
> errors you get, as it will show if you're missing out anything
> important and give a clue about which type of symbols are missing.

Ok I try, but it's really a lot of stuff.

If I use nm, I see a lot of undefined symbols, such as

nm -DC .libs/libgroupsock.so

                 w _Jv_RegisterClasses
                 U _Unwind_Resume
                 U readSocket(UsageEnvironment&, int, unsigned char*,
unsigned int, sockaddr_in&)
                 U writeSocket(UsageEnvironment&, int, in_addr, Port,
unsigned char, unsigned char*, unsigned int)
                 U ourIPAddress(UsageEnvironment&)
                 U getSourcePort(UsageEnvironment&, int, Port&)
                 U socketJoinGroup(UsageEnvironment&, int, unsigned int)
                 U timestampString()
                 U socketLeaveGroup(UsageEnvironment&, int, unsigned int)
0000000000005610 T socketReadHandler(Socket*, int)
                 U IsMulticastAddress(unsigned int)
                 U socketJoinGroupSSM(UsageEnvironment&, int, unsigned
int, unsigned int)
                 U socketLeaveGroupSSM(UsageEnvironment&, int, unsigned
int, unsigned int)
                 U strDup(char const*)
0000000000003b30 T destRecord::destRecord(in_addr const&, Port const&,
unsigned char, destRecord*)

But for example readSocket is implemented in
groupsock/GroupsockHelper.cpp . I don't think it's normal.


This is the generation of librtsp.so, which is my library

libtool: link: g++ -shared -nostdlib
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crti.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtbeginS.o  .libs/librtsp_la-rtsp.o
.libs/queue.o .libs/librtsp_la-VT_JPEGVideoSource.o
.libs/librtsp_la-VT_JPEGVideoRTPSource.o
.libs/librtsp_la-VT_MediaSession.o .libs/librtsp_la-VideoDeviceSource.o
.libs/librtsp_la-AudioDeviceSource.o
.libs/librtsp_la-DetectionDeviceSource.o
.libs/librtsp_la-VideoOnDemandServerMediaSubsession.o
.libs/librtsp_la-DetectionOnDemandServerMediaSubsession.o
.libs/librtsp_la-VT_H264VideoStreamFramer.o
.libs/librtsp_la-VT_DetectionFileServerMediaSubsession.o
.libs/librtsp_la-VT_RTSPServer.o .libs/librtsp_la-VT_Sink.o
.libs/base64.o   -Wl,-rpath
-Wl,/home/ottavio/Projects/albert/src/protocols/rtsp/.libs -Wl,-rpath
-Wl,/opt/lib -lpthread ./.libs/libUsageEnvironment.so
./.libs/libBasicUsageEnvironment.so ./.libs/libgroupsock.so
./.libs/libliveMedia.so -L/usr/lib/gcc/x86_64-linux-gnu/4.4.5
-L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib -L/lib/../lib
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../..
-L/usr/lib/x86_64-linux-gnu -lstdc++ -lm -lc -lgcc_s
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crtn.o
-Wl,-soname -Wl,librtsp.so.1 -o .libs/librtsp.so.1.0.0


These are libliveMedia.so, libgroupsock.so , libUsageEnvironment.so and
libBasicUsageEnvironment.so which are the four libraries of liveMedia


libtool: link: g++ -shared -nostdlib
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crti.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtbeginS.o
.libs/libliveMedia_la-MPEGVideoStreamFramer.o
.libs/libliveMedia_la-AC3AudioStreamFramer.o
.libs/libliveMedia_la-DarwinInjector.o .libs/libliveMedia_la-our_md5.o
.libs/libliveMedia_la-AMRAudioFileSource.o
.libs/libliveMedia_la-ServerMediaSession.o
.libs/libliveMedia_la-AMRAudioFileServerMediaSubsession.o
.libs/libliveMedia_la-Base64.o .libs/libliveMedia_la-JPEGVideoSource.o
.libs/libliveMedia_la-MP3ADUinterleaving.o
.libs/libliveMedia_la-H264VideoFileServerMediaSubsession.o
.libs/libliveMedia_la-MPEG1or2FileServerDemux.o
.libs/libliveMedia_la-MP3ADURTPSource.o
.libs/libliveMedia_la-H264VideoRTPSink.o
.libs/libliveMedia_la-MPEG2TransportStreamTrickModeFilter.o
.libs/libliveMedia_la-AudioRTPSink.o
.libs/libliveMedia_la-MPEG2TransportFileServerMediaSubsession.o
.libs/libliveMedia_la-WAVAudioFileServerMediaSubsession.o
.libs/libliveMedia_la-MediaSink.o
.libs/libliveMedia_la-MPEG1or2DemuxedElementaryStream.o
.libs/libliveMedia_la-H261VideoRTPSource.o
.libs/libliveMedia_la-BasicUDPSource.o
.libs/libliveMedia_la-MP3AudioFileServerMediaSubsession.o
.libs/libliveMedia_la-RTSPServerSupportingHTTPStreaming.o
.libs/libliveMedia_la-MPEGVideoStreamParser.o
.libs/libliveMedia_la-ADTSAudioFileSource.o
.libs/libliveMedia_la-DeviceSource.o
.libs/libliveMedia_la-DVVideoRTPSink.o
.libs/libliveMedia_la-MP3ADUdescriptor.o
.libs/libliveMedia_la-MP3Internals.o
.libs/libliveMedia_la-H263plusVideoStreamFramer.o
.libs/libliveMedia_la-BitVector.o
.libs/libliveMedia_la-QCELPAudioRTPSource.o
.libs/libliveMedia_la-H263plusVideoRTPSink.o
.libs/libliveMedia_la-MP3FileSource.o
.libs/libliveMedia_la-H264VideoRTPSource.o
.libs/libliveMedia_la-MPEG1or2DemuxedServerMediaSubsession.o
.libs/libliveMedia_la-ByteStreamMultiFileSource.o
.libs/libliveMedia_la-our_md5hl.o
.libs/libliveMedia_la-SimpleRTPSource.o
.libs/libliveMedia_la-MP3ADURTPSink.o
.libs/libliveMedia_la-MP3InternalsHuffman.o
.libs/libliveMedia_la-JPEGVideoRTPSource.o
.libs/libliveMedia_la-JPEGVideoRTPSink.o
.libs/libliveMedia_la-AMRAudioRTPSource.o
.libs/libliveMedia_la-MPEG4VideoFileServerMediaSubsession.o
.libs/libliveMedia_la-OutputFile.o
.libs/libliveMedia_la-MPEG1or2AudioRTPSource.o
.libs/libliveMedia_la-RTPSource.o
.libs/libliveMedia_la-PassiveServerMediaSubsession.o
.libs/libliveMedia_la-FramedFileSource.o
.libs/libliveMedia_la-MPEG1or2VideoStreamDiscreteFramer.o
.libs/libliveMedia_la-H263plusVideoStreamParser.o
.libs/libliveMedia_la-QuickTimeFileSink.o
.libs/libliveMedia_la-MPEG2TransportStreamFromESSource.o
.libs/libliveMedia_la-MediaSource.o
.libs/libliveMedia_la-MPEG1or2VideoRTPSink.o
.libs/libliveMedia_la-AVIFileSink.o
.libs/libliveMedia_la-MultiFramedRTPSink.o
.libs/libliveMedia_la-MPEG1or2VideoStreamFramer.o
.libs/libliveMedia_la-MPEG4GenericRTPSource.o
.libs/libliveMedia_la-AMRAudioRTPSink.o
.libs/libliveMedia_la-AMRAudioFileSink.o
.libs/libliveMedia_la-FramedFilter.o
.libs/libliveMedia_la-H263plusVideoFileServerMediaSubsession.o
.libs/libliveMedia_la-BasicUDPSink.o
.libs/libliveMedia_la-MPEG1or2AudioRTPSink.o
.libs/libliveMedia_la-MediaSession.o
.libs/libliveMedia_la-MPEG4LATMAudioRTPSink.o
.libs/libliveMedia_la-MP3HTTPSource.o
.libs/libliveMedia_la-DVVideoRTPSource.o
.libs/libliveMedia_la-RTPInterface.o
.libs/libliveMedia_la-SimpleRTPSink.o
.libs/libliveMedia_la-MPEG1or2VideoRTPSource.o
.libs/libliveMedia_la-H263plusVideoRTPSource.o
.libs/libliveMedia_la-MPEG1or2Demux.o
.libs/libliveMedia_la-AudioInputDevice.o
.libs/libliveMedia_la-MPEG1or2VideoFileServerMediaSubsession.o
.libs/libliveMedia_la-RTSPCommon.o
.libs/libliveMedia_la-FileServerMediaSubsession.o
.libs/libliveMedia_la-InputFile.o .libs/libliveMedia_la-RTPSink.o
.libs/libliveMedia_la-MP3ADU.o .libs/libliveMedia_la-RTCP.o
.libs/libliveMedia_la-MultiFramedRTPSource.o
.libs/libliveMedia_la-FramedSource.o .libs/libliveMedia_la-Media.o
-L/usr/lib/gcc/x86_64-linux-gnu/4.4.5
-L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib -L/lib/../lib
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../..
-L/usr/lib/x86_64-linux-gnu -lstdc++ -lm -lc -lgcc_s
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crtn.o
-Wl,-soname -Wl,libliveMedia.so.2009 -o .libs/libliveMedia.so.2009.2.9


libtool: link: g++ -shared -nostdlib
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crti.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtbeginS.o
.libs/libgroupsock_la-Groupsock.o .libs/libgroupsock_la-GroupEId.o
.libs/libgroupsock_la-IOHandlers.o
-L/usr/lib/gcc/x86_64-linux-gnu/4.4.5
-L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib -L/lib/../lib
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../..
-L/usr/lib/x86_64-linux-gnu -lstdc++ -lm -lc -lgcc_s
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crtn.o
-Wl,-soname -Wl,libgroupsock.so.2009 -o .libs/libgroupsock.so.2009.2.9


libtool: link: g++ -shared -nostdlib
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crti.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtbeginS.o
.libs/libUsageEnvironment_la-UsageEnvironment.o
.libs/libUsageEnvironment_la-strDup.o
.libs/libUsageEnvironment_la-HashTable.o
-L/usr/lib/gcc/x86_64-linux-gnu/4.4.5
-L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib -L/lib/../lib
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../..
-L/usr/lib/x86_64-linux-gnu -lstdc++ -lm -lc -lgcc_s
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crtn.o
-Wl,-soname -Wl,libUsageEnvironment.so.2009 -o
.libs/libUsageEnvironment.so.2009.2.9


libtool: link: g++ -shared -nostdlib
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crti.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtbeginS.o
.libs/libBasicUsageEnvironment_la-BasicUsageEnvironment.o
.libs/libBasicUsageEnvironment_la-BasicUsageEnvironment0.o
.libs/libBasicUsageEnvironment_la-DelayQueue.o
.libs/libBasicUsageEnvironment_la-BasicTaskScheduler0.o
.libs/libBasicUsageEnvironment_la-BasicTaskScheduler.o
.libs/libBasicUsageEnvironment_la-BasicHashTable.o
-L/usr/lib/gcc/x86_64-linux-gnu/4.4.5
-L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib -L/lib/../lib
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../..
-L/usr/lib/x86_64-linux-gnu -lstdc++ -lm -lc -lgcc_s
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crtn.o
-Wl,-soname -Wl,libBasicUsageEnvironment.so.2009 -o
.libs/libBasicUsageEnvironment.so.2009.2.9


And that's when I try to link all together, I just post a few errors


libtool: link: gcc -g -O2 -Wall -D_GNU_SOURCE -I../../protocols/rtsp/
-I../../protocols/common/ -I../common/ -I../agent/ -g -O2 -o
.libs/rtsp_proxy rtsp_proxy-main.o rtsp_proxy-variables.o
rtsp_proxy-base64.o rtsp_proxy-queue.o rtsp_proxy-posix_queue.o
../../protocols/rtsp/.libs/librtsp.so
../../protocols/rtsp/.libs/libBasicUsageEnvironment.so
../../protocols/rtsp/.libs/libUsageEnvironment.so
../../protocols/rtsp/.libs/libgroupsock.so
../../protocols/rtsp/.libs/libliveMedia.so -Wl,-rpath -Wl,/opt/lib
../../protocols/rtsp/.libs/libliveMedia.so: undefined reference to
`AMRAudioSource::~AMRAudioSource()'
../../protocols/rtsp/.libs/librtsp.so: undefined reference to
`RTSPServer::setUpOurSocket(UsageEnvironment&, Port&)'
../../protocols/rtsp/.libs/libliveMedia.so: undefined reference to
`AMRAudioSource::isAMRAudioSource() const'
../../protocols/rtsp/.libs/libgroupsock.so: undefined reference to
`our_inet_ntoa'
../../protocols/rtsp/.libs/libliveMedia.so: undefined reference to
`StreamParser::~StreamParser()'
../../protocols/rtsp/.libs/libgroupsock.so: undefined reference to
`DirectedNetInterfaceSet::Iterator::next()'
../../protocols/rtsp/.libs/libliveMedia.so: undefined reference to
`increaseReceiveBufferTo(UsageEnvironment&, int, unsigned int)'
../../protocols/rtsp/.libs/libliveMedia.so: undefined reference to
`uLawFromPCMAudioSource::createNew(UsageEnvironment&, FramedSource*, int)'
../../protocols/rtsp/.libs/libliveMedia.so: undefined reference to
`RTSPClient::isRTSPClient() const'
...
...




Thank you,

Ottavio


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux