【发布时间】:2019-05-27 19:21:30
【问题描述】:
我有一些 c++ 代码(Snowboy 演示 - demo.cc)并使用 g++ 在我的 RaspPI Zero 上成功构建它:
g++ -D_GLIBCXX_USE_CXX11_ABI=0 -fPIC -I../../ -std=c++0x -Wall -Wno-sign-compare -Wno-unused-local-typedefs -Winit-self -rdynamic -DHAVE_POSIX_MEMALIGN -Iportaudio/install/include -O3 demo.cc portaudio/install/lib/libportaudio.a ../..//lib/rpi/libsnowboy-detect.a -ldl -lm -Wl,-Bstatic -Wl,-Bdynamic -lrt -lpthread portaudio/install/lib/libportaudio.a -L/usr/lib/atlas-base -lf77blas -lcblas -llapack_atlas -latlas -lasound -o demo
为了调试它,我尝试使用 QtCreator 并创建 Qt 项目文件:
QT -= gui
CONFIG += c++11 console
CONFIG -= app_bundle
HEADERS += demo.h
SOURCES += \
demo.cc
INCLUDEPATH += ../../
INCLUDEPATH += portaudio/install/include
LIBS += -Lportaudio/install/lib \
-lportaudio \
-L../../lib/rpi -lsnowboy-detect \
-L/usr/lib/atlas-base \
-ldl -lm -lrt -lpthread \
-lf77blas -lcblas -llapack_atlas -latlas -lasound
但在 QtCreator 中使用此配置时,我收到构建错误:
/home/pi/Prj/snowboy/examples/C++/demo.cc:213: error: undefined reference to `snowboy::SnowboyDetect::SnowboyDetect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
我是否忘记在 Qt 项目文件中指定与 g++ 一起使用的任何参数?
你有没有可能告诉我一种在 Raspb Pi 零中调试具有外部依赖关系的 c++ 代码的简单方法?
【问题讨论】:
标签: c++ qt qt-creator qmake