我试图将共享对象库链接到我的项目,但似乎没有任何效果。
这是制作项目过程的结束:
/bin/bash ./libtool --tag=CXX --mode=link g++ -D_REENTRANT -g -O2 -o liborkbase.la -rpath /usr/lib Filter.lo g711.lo OrkBase.lo Object.lo ObjectFactory.lo OrkClient.lo AudioCapture.lo Utils.lo AudioTape.lo CommandProcessing.lo Config.lo ConfigManager.lo LogManager.lo MultiThreadedServer.lo TapeProcessor.lo MemUtils.lo BatchProcessing.lo CapturePluginProxy.lo CapturePort.lo Daemon.lo ImmediateProcessing.lo Reporting.lo TapeFileNaming.lo PartyFilter.lo EventStreaming.lo OrkTrack.lo SocketStreamer.lo SizedBuffer.lo DirectionSelector.lo ./serializers/libserializers.la ./messages/libmessages.la ./audiofile/libaudiofile.la ./filters/gsm/libgsm.la ./filters/gsm/gsm610/libgsm610.la ./filters/ilbc/libilbc.la ./filters/ilbc/ilbc/libilbcrfc.la ./filters/audiogain/libaudiogain.la ./filters/g722codec/libg722codec.la ./filters/speex/libspeexcodec.la ./filters/g726codecs/libg721codec.la ./filters/g726codecs/g72x/libg72x.la ./filters/g729codec/libg729codec.la
libtool: link: g++ -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/6/crtbeginS.o .libs/Filter.o .libs/g711.o .libs/OrkBase.o .libs/Object.o .libs/ObjectFactory.o .libs/OrkClient.o .libs/AudioCapture.o .libs/Utils.o .libs/AudioTape.o .libs/CommandProcessing.o .libs/Config.o .libs/ConfigManager.o .libs/LogManager.o .libs/MultiThreadedServer.o .libs/TapeProcessor.o .libs/MemUtils.o .libs/BatchProcessing.o .libs/CapturePluginProxy.o .libs/CapturePort.o .libs/Daemon.o .libs/ImmediateProcessing.o .libs/Reporting.o .libs/TapeFileNaming.o .libs/PartyFilter.o .libs/EventStreaming.o .libs/OrkTrack.o .libs/SocketStreamer.o .libs/SizedBuffer.o .libs/DirectionSelector.o -Wl,--whole-archive ./serializers/.libs/libserializers.a ./messages/.libs/libmessages.a ./audiofile/.libs/libaudiofile.a ./filters/gsm/.libs/libgsm.a ./filters/gsm/gsm610/.libs/libgsm610.a ./filters/ilbc/.libs/libilbc.a ./filters/ilbc/ilbc/.libs/libilbcrfc.a ./filters/audiogain/.libs/libaudiogain.a ./filters/g722codec/.libs/libg722codec.a ./filters/speex/.libs/libspeexcodec.a ./filters/g726codecs/.libs/libg721codec.a ./filters/g726codecs/g72x/.libs/libg72x.a ./filters/g729codec/.libs/libg729codec.a -Wl,--no-whole-archive -L/usr/lib/gcc/x86_64-linux-gnu/6 -L/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/6/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/6/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crtn.o -g -O2 -Wl,-soname -Wl,liborkbase.so.0 -o .libs/liborkbase.so.0.0.0
libtool: link: (cd ".libs" && rm -f "liborkbase.so.0" && ln -s "liborkbase.so.0.0.0" "liborkbase.so.0")
libtool: link: (cd ".libs" && rm -f "liborkbase.so" && ln -s "liborkbase.so.0.0.0" "liborkbase.so")
libtool: link: (cd .libs/liborkbase.lax/libserializers.a && ar x "/root/oreka-svn/orkbasecxx/./serializers/.libs/libserializers.a")
libtool: link: (cd .libs/liborkbase.lax/libmessages.a && ar x "/root/oreka-svn/orkbasecxx/./messages/.libs/libmessages.a")
libtool: link: (cd .libs/liborkbase.lax/libaudiofile.a && ar x "/root/oreka-svn/orkbasecxx/./audiofile/.libs/libaudiofile.a")
libtool: link: (cd .libs/liborkbase.lax/libgsm.a && ar x "/root/oreka-svn/orkbasecxx/./filters/gsm/.libs/libgsm.a")
libtool: link: (cd .libs/liborkbase.lax/libgsm610.a && ar x "/root/oreka-svn/orkbasecxx/./filters/gsm/gsm610/.libs/libgsm610.a")
libtool: link: (cd .libs/liborkbase.lax/libilbc.a && ar x "/root/oreka-svn/orkbasecxx/./filters/ilbc/.libs/libilbc.a")
libtool: link: (cd .libs/liborkbase.lax/libilbcrfc.a && ar x "/root/oreka-svn/orkbasecxx/./filters/ilbc/ilbc/.libs/libilbcrfc.a")
libtool: link: (cd .libs/liborkbase.lax/libaudiogain.a && ar x "/root/oreka-svn/orkbasecxx/./filters/audiogain/.libs/libaudiogain.a")
libtool: link: (cd .libs/liborkbase.lax/libg722codec.a && ar x "/root/oreka-svn/orkbasecxx/./filters/g722codec/.libs/libg722codec.a")
libtool: link: (cd .libs/liborkbase.lax/libspeexcodec.a && ar x "/root/oreka-svn/orkbasecxx/./filters/speex/.libs/libspeexcodec.a")
libtool: link: (cd .libs/liborkbase.lax/libg721codec.a && ar x "/root/oreka-svn/orkbasecxx/./filters/g726codecs/.libs/libg721codec.a")
libtool: link: (cd .libs/liborkbase.lax/libg72x.a && ar x "/root/oreka-svn/orkbasecxx/./filters/g726codecs/g72x/.libs/libg72x.a")
libtool: link: (cd .libs/liborkbase.lax/libg729codec.a && ar x "/root/oreka-svn/orkbasecxx/./filters/g729codec/.libs/libg729codec.a")
libtool: link: ar cru .libs/liborkbase.a Filter.o g711.o OrkBase.o Object.o ObjectFactory.o OrkClient.o AudioCapture.o Utils.o AudioTape.o CommandProcessing.o Config.o ConfigManager.o LogManager.o MultiThreadedServer.o TapeProcessor.o MemUtils.o BatchProcessing.o CapturePluginProxy.o CapturePort.o Daemon.o ImmediateProcessing.o Reporting.o TapeFileNaming.o PartyFilter.o EventStreaming.o OrkTrack.o SocketStreamer.o SizedBuffer.o DirectionSelector.o .libs/liborkbase.lax/libserializers.a/DomSerializer.o .libs/liborkbase.lax/libserializers.a/Serializer.o .libs/liborkbase.lax/libserializers.a/SingleLineSerializer.o .libs/liborkbase.lax/libserializers.a/UrlSerializer.o .libs/liborkbase.lax/libserializers.a/XmlRpcSerializer.o .libs/liborkbase.lax/libmessages.a/AddTagMsg.o .libs/liborkbase.lax/libmessages.a/AsyncMessage.o .libs/liborkbase.lax/libmessages.a/CaptureMsg.o .libs/liborkbase.lax/libmessages.a/CrashMessage.o .libs/liborkbase.lax/libmessages.a/DeleteTapeMsg.o .libs/liborkbase.lax/libmessages.a/InitMsg.o .libs/liborkbase.lax/libmessages.a/Message.o .libs/liborkbase.lax/libmessages.a/PingMsg.o .libs/liborkbase.lax/libmessages.a/RecordMsg.o .libs/liborkbase.lax/libmessages.a/SyncMessage.o .libs/liborkbase.lax/libmessages.a/TapeMsg.o .libs/liborkbase.lax/libaudiofile.a/AudioFile.o .libs/liborkbase.lax/libaudiofile.a/LibSndFileFile.o .libs/liborkbase.lax/libaudiofile.a/MediaChunkFile.o .libs/liborkbase.lax/libaudiofile.a/PcmFile.o .libs/liborkbase.lax/libgsm.a/GsmFilters.o .libs/liborkbase.lax/libgsm610.a/add.o .libs/liborkbase.lax/libgsm610.a/code.o .libs/liborkbase.lax/libgsm610.a/decode.o .libs/liborkbase.lax/libgsm610.a/gsm_create.o .libs/liborkbase.lax/libgsm610.a/gsm_decode.o .libs/liborkbase.lax/libgsm610.a/gsm_destroy.o .libs/liborkbase.lax/libgsm610.a/gsm_encode.o .libs/liborkbase.lax/libgsm610.a/gsm_option.o .libs/liborkbase.lax/libgsm610.a/long_term.o .libs/liborkbase.lax/libgsm610.a/lpc.o .libs/liborkbase.lax/libgsm610.a/preprocess.o .libs/liborkbase.lax/libgsm610.a/rpe.o .libs/liborkbase.lax/libgsm610.a/short_term.o .libs/liborkbase.lax/libgsm610.a/table.o .libs/liborkbase.lax/libilbc.a/IlbcFilters.o .libs/liborkbase.lax/libilbcrfc.a/FrameClassify.o .libs/liborkbase.lax/libilbcrfc.a/LPCdecode.o .libs/liborkbase.lax/libilbcrfc.a/LPCencode.o .libs/liborkbase.lax/libilbcrfc.a/StateConstructW.o .libs/liborkbase.lax/libilbcrfc.a/StateSearchW.o .libs/liborkbase.lax/libilbcrfc.a/anaFilter.o .libs/liborkbase.lax/libilbcrfc.a/constants.o .libs/liborkbase.lax/libilbcrfc.a/createCB.o .libs/liborkbase.lax/libilbcrfc.a/doCPLC.o .libs/liborkbase.lax/libilbcrfc.a/enhancer.o .libs/liborkbase.lax/libilbcrfc.a/gainquant.o .libs/liborkbase.lax/libilbcrfc.a/getCBvec.o .libs/liborkbase.lax/libilbcrfc.a/helpfun.o .libs/liborkbase.lax/libilbcrfc.a/hpInput.o .libs/liborkbase.lax/libilbcrfc.a/hpOutput.o .libs/liborkbase.lax/libilbcrfc.a/iCBConstruct.o .libs/liborkbase.lax/libilbcrfc.a/iCBSearch.o .libs/liborkbase.lax/libilbcrfc.a/iLBC_decode.o .libs/liborkbase.lax/libilbcrfc.a/iLBC_encode.o .libs/liborkbase.lax/libilbcrfc.a/iLBC_filter.o .libs/liborkbase.lax/libilbcrfc.a/lsf.o .libs/liborkbase.lax/libilbcrfc.a/packing.o .libs/liborkbase.lax/libilbcrfc.a/syntFilter.o .libs/liborkbase.lax/libaudiogain.a/AudioGain.o .libs/liborkbase.lax/libg722codec.a/G722Codec.o .libs/liborkbase.lax/libspeexcodec.a/SpeexCodec.o .libs/liborkbase.lax/libg721codec.a/G721Codec.o .libs/liborkbase.lax/libg72x.a/g721.o .libs/liborkbase.lax/libg72x.a/g723_24.o .libs/liborkbase.lax/libg72x.a/g723_40.o .libs/liborkbase.lax/libg72x.a/g72x.o .libs/liborkbase.lax/libg729codec.a/G729Codec.o
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/liborkbase.a
libtool: link: rm -fr .libs/liborkbase.lax
libtool: link: ( cd ".libs" && rm -f "liborkbase.la" && ln -s "../liborkbase.la" "liborkbase.la" )
make[2]: Leaving directory '/root/oreka-svn/orkbasecxx'
make[1]: Leaving directory '/root/oreka-svn/orkbasecxx'
我要链接的图书馆位于:
/usr/local/lib/libbcg729.a
/usr/local/lib/libbcg729.la
/usr/local/lib/libbcg729.so
/usr/local/lib/libbcg729.so.0
/usr/local/lib/libbcg729.so.0.0.0
/usr/local/lib/pkgconfig/libbcg729.pc
我已将 / usr / local / lib 目录添加到ldconfig。
这里的确切问题是我有一个名为 G729Codec 的类,它调用 libgcb729 库中包含的两个函数,从调用这些函数时我得到执行时错误 G729codec 类,这里是如何编译 G729codec 类:
make[3]: Entering directory '/root/oreka-svn/orkbasecxx/filters/g729codec'
make[4]: Entering directory '/root/oreka-svn/orkbasecxx/filters/g729codec'
/bin/bash ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -D_REENTRANT -g -O2 -MT G729Codec.lo -MD -MP -MF .deps/G729Codec.Tpo -c -o G729Codec.lo G729Codec.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -D_REENTRANT -g -O2 -MT G729Codec.lo -MD -MP -MF .deps/G729Codec.Tpo -c G729Codec.cpp -fPIC -DPIC -o .libs/G729Codec.o
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -D_REENTRANT -g -O2 -MT G729Codec.lo -MD -MP -MF .deps/G729Codec.Tpo -c G729Codec.cpp -o G729Codec.o >/dev/null 2>&1
mv -f .deps/G729Codec.Tpo .deps/G729Codec.Plo
/bin/bash ../../libtool --tag=CXX --mode=link g++ -D_REENTRANT -g -O2 -o libg729codec.la G729Codec.lo
libtool: link: ar cru .libs/libg729codec.a .libs/G729Codec.o
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libg729codec.a
libtool: link: ( cd ".libs" && rm -f "libg729codec.la" && ln -s "../libg729codec.la" "libg729codec.la" )
为了让我的项目识别出libbcg729库,我该怎么做?
答案 0 :(得分:0)
您的项目正在使用自动工具,因此您可以在构建之前尝试设置LDFLAGS环境变量,如:export LDFLAGS="-lbcg729"
。但是你的问题没有足够的细节;你应该粘贴你所看到的链接器错误。