c++ - 在 Gaia 支持下构建音频分析库 Essentia 失败

标签 c++ namespaces

我正在尝试构建 Essentia ( https://github.com/MTG/essentia ),一个音频分析库,带有 Gaia ( https://github.com/MTG/gaia ) 支持 Debian 9.0从源头。在此之前,它的一个依赖项,即 Gaia ,也从源代码成功构建。它安装在 /usr/local/ .

说到Essentia , 源代码编译失败并出现以下错误:

[...]
        In file included from ../src/algorithms/essentia_algorithms_reg.cpp:21:0:
    ../src/algorithms/highlevel/gaiatransform.h: At global scope:
    ../src/algorithms/highlevel/gaiatransform.h:37:10: error: ‘TransfoChain’ in namespace ‘gaia2’ does not name a type
       gaia2::TransfoChain _history;
              ^~~~~~~~~~~~
    ../src/algorithms/highlevel/gaiatransform.h: In constructor ‘essentia::standard::GaiaTransform::GaiaTransform()’:
    ../src/algorithms/highlevel/gaiatransform.h:47:5: error: ‘init’ is not a member of ‘gaia2’
         gaia2::init();
         ^~~~~
    ../src/algorithms/highlevel/gaiatransform.h:47:5: note: suggested alternative:
    In file included from ../src/essentia/algorithmfactory.h:27:0,
                     from ../src/algorithms/essentia_algorithms_reg.cpp:1:
    ../src/essentia/essentia.h:46:6: note:   ‘essentia::init’
     void init();
          ^~~~

错误所在的文件是/src/algorithms/essentia_algorithms_reg.cpp这是编译文件的命令:
/usr/bin/g++ -pipe -Wall -std=c++03 -msse -msse2 -mfpmath=sse -O2 -fPIC -pthread -Isrc -I../src -Isrc/essentia -I../src/essentia -Isrc/essentia/scheduler -I../src/essentia/scheduler -Isrc/essentia/streaming -I../src/essentia/streaming -Isrc/essentia/streaming/algorithms -I../src/essentia/streaming/algorithms -Isrc/essentia/utils -I../src/essentia/utils -Isrc/3rdparty -I../src/3rdparty -Isrc/3rdparty/spline -I../src/3rdparty/spline -Isrc/3rdparty/vamp-plugin-sdk-2.4 -I../src/3rdparty/vamp-plugin-sdk-2.4 -I/usr/include/x86_64-linux-gnu -I/usr/include/taglib -I/usr/local/include -I/usr/include/qt4 -I/usr/include/qt4/QtCore -I/usr/local/include/gaia2/ -DHAVE_AVCODEC=1 -DHAVE_AVFORMAT=1 -DHAVE_AVUTIL=1 -DHAVE_AVRESAMPLE=1 -DHAVE_SAMPLERATE=1 -DHAVE_TAGLIB=1 -DHAVE_YAML=1 -DHAVE_FFTW=1 -DHAVE_GAIA2=1 -D__STDC_CONSTANT_MACROS -DPYTHONDIR="/usr/local/lib/python2.7/dist-packages" -DPYTHONARCHDIR="/usr/local/lib/python2.7/dist-packages" -DHAVE_PYEMBED=1 -DHAVE_PYEXT=1 -DHAVE_PYTHON_H=1 ../src/algorithms/essentia_algorithms_reg.cpp -c -o/home/hamidi/essentia/build/src/algorithms/essentia_algorithms_reg.cpp.1.o -fPIC -v
g++-v选项给了我链接器访问的实际路径(我认为没有什么不好的,但为了完整起见):
#include "..." search starts here:
#include <...> search starts here:
 src
 ../src
 src/essentia
 ../src/essentia
 src/essentia/scheduler
 ../src/essentia/scheduler
 src/essentia/streaming
 ../src/essentia/streaming
 src/essentia/streaming/algorithms
 ../src/essentia/streaming/algorithms
 src/essentia/utils
 ../src/essentia/utils
 src/3rdparty
 ../src/3rdparty
 src/3rdparty/spline
 ../src/3rdparty/spline
 src/3rdparty/vamp-plugin-sdk-2.4
 ../src/3rdparty/vamp-plugin-sdk-2.4
 /usr/include/taglib
 /usr/include/qt4
 /usr/include/qt4/QtCore
 /usr/local/include/gaia2/
 /usr/include/c++/6
 /usr/include/x86_64-linux-gnu/c++/6
 /usr/include/c++/6/backward
 /usr/lib/gcc/x86_64-linux-gnu/6/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/6/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.

以下是错误中涉及的文件(github repo):
  • MTG/gaia/blob/master/src/gaia.h
  • MTG/gaia/blob/master/src/transformation.h#L106
  • /MTG/essentia/blob/master/src/algorithms/highlevel/gaiatransform.h
  • 最佳答案

    最后是配置Gaia时出现的错误这导致了问题。实际上,不仅仅是使用以下配置选项:

    ./waf configure --with-python-bindings --with-asserts --with-cyclops
    

    选项 --with-stlfacade无意中添加的。使用 Gaia 时,此选项不兼容结合 Essentia .

    关于c++ - 在 Gaia 支持下构建音频分析库 Essentia 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45845260/

    相关文章:

    c++ - 人口增长模式与预期不符

    properties - 未使用复合应用程序为此命名空间定义属性

    从模板化基类检索 constexpr 的 C++ 元函数

    c++ - 套接字上的并行读/写

    Django CMS apphook 命名空间

    php - 从类中获取 use 语句

    c# - 'ListViewWebPart' 是一个 'namespace' 但像 'type' 一样使用

    .net - .NET 框架中程序集和命名空间之间的关系?

    c++ - 返回指向数组的指针

    c++ - SpriteSheet 动画 -> 滞后?