【问题标题】:linking/building portaudio static library链接/构建 portaudio 静态库
【发布时间】:2012-12-05 14:18:25
【问题描述】:

我正在尝试使用来自 portaudio 的静态库,方法是在编译 portaudio 后将 "libportaudio.a" 放入我的项目中(通过执行“./configre && make”,然后我获取了文件在 lib/.libs/)。

由于这是一个 qt 项目,我的 Makefile Lib 行如下所示:

LIBS          = $(SUBLIBS)  -L/usr/lib/x86_64-linux-gnu -L/home/larose/babel/BabelAudio/lib -Lportaudio -Llibspeex -Llibspeexdsp -lQtGui -lQtNetwork -lQtCore -lpthread

在我的 .pro 中,我有:

LIBS += -L$$PWD/lib -Lportaudio -Llibspeex -Llibspeexdsp

但是当我尝试做 make 时,结果是:

SpeakThread.cpp:(.text+0x388): undefined reference to `Pa_OpenStream'
SpeakThread.cpp:(.text+0x3c7): undefined reference to `Pa_OpenStream'
SpeakThread.cpp:(.text+0x3d0): undefined reference to `Pa_StartStream'
SpeakThread.cpp:(.text+0x3da): undefined reference to `Pa_StartStream'
SpeakThread.cpp:(.text+0x3e4): undefined reference to `Pa_IsStreamActive'

在执行 ./configure 以使库可移植或只是在 Makefile 中进行一些更改时,有什么特别的事情要做吗?

【问题讨论】:

    标签: gcc makefile static-libraries qmake portaudio


    【解决方案1】:

    你应该使用-l 而不是-L

    -lportaudio 
    

    【讨论】:

      猜你喜欢
      • 2012-04-17
      • 1970-01-01
      • 1970-01-01
      • 2016-08-21
      • 2013-06-24
      • 2010-10-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多