如何使用第三方dll(libaudiofile)编译INET

时间:2019-06-26 09:12:59

标签: omnet++

我需要使用一些音频功能来编译INET。我正在将Omnet ++ 5.1与INET 3.5.0一起使用。 从audiofile 0.3.6包中,我添加了2个需要的文件audiofile.h和aupvlist.h 现在,当我构建它时,缺少函数afWriteFrames' afInitSampleFormat'等。应在libaudiofile.dll中定义此函数。 我的问题是如何从dll中获取功能?

我将路径添加到库libaudiofile.dll,但Omnet不想使用这些功能。我试图将libaudiofile.dll复制到Windows \ System32和SysWOW64,但没有任何效果。还是一样的错误。

make MODE=release all 
cd src && /usr/bin/make
make[1]: Entering directory '/d/OmnetWorkspace/inet-dev/src'
*** COMPILING with:
g++ -c -std=c++11 -O2 -DNDEBUG=1 -MMD -MP -MF .d    -isystem /usr/include -isystem /mingw64/include -fno-stack-protector  -DXMLPARSER=libxml -DPREFER_QTENV -DWITH_QTENV -DWITH_TKENV -DWITH_PARSIM -DWITH_NETBUILDER -              
*** LINKING with:
g++ -shared  -o ../out/gcc-release/src/libINET.dll -Wl,--no-as-needed -Wl,--whole-archive  -lwsock32 -Wl,--no-whole-archive -loppenvir -loppsim -lstdc++  -lOpenThreads -losg -losgText -losgDB -losgEarth -losgEarthUtil -Wl,-rpath,D:/omnetpp-5.1/lib     
Building...

Creating shared library: ../out/gcc-release/src/libINET.dll
.tmplib5636(RTPAVProfilePayload10Receiver.o):RTPAVProfilePayload10Receiver.cc:(.text+0xb3): undefined reference to `afWriteFrames'
.tmplib5636(RTPAVProfileSampleBasedAudioReceiver.o):RTPAVProfileSampleBasedAudioReceiver.cc:(.text+0x9d): undefined reference to `afNewFileSetup'
.tmplib5636(RTPAVProfileSampleBasedAudioReceiver.o):RTPAVProfileSampleBasedAudioReceiver.cc:(.text+0xb7): undefined reference to `afInitByteOrder'

collect2.exe: error: ld returned 1 exit status
make[1]: *** [Makefile:1156: ../out/gcc-release/src/libINET.dll] Error 1
make[1]: Leaving directory '/d/OmnetWorkspace/inet-dev/src'
make: *** [Makefile:6: all] Error 2

1 个答案:

答案 0 :(得分:0)

在文本编辑器中打开src/makefrag,然后在末尾添加:

LIBS += -L/c/libraries/audiofile  -laudiofile

假设libaudiofile.dllC:\libraries\audiofile中。