Search code examples
androidc++boostandroid-ndkaudio-fingerprinting

Should I Compile Required Files Or Just Include them?


Im building an echoprint echonest android app to identify music. I've followed this tutorial where the required packages for echoprint codegen is boost 1.54.0 and it is just included for the echoprint codegen in the android.mk file. This works perfectly the codegen generates the sound code but it doesn't make any matches even for popular songs like Gangnam Style. I was wondering wether I should also compile the Boost files or.


Solution

  • In general: you don't compile required files if they are header-only. However, you must compile them if they have also source files.

    echoprint-codegen only uses boost headers for some numeric operations, so you don't need to compile boost (source)

    The libraries used by echoprint-codegen

    #include <boost/numeric/ublas/matrix.hpp>
    #include <boost/numeric/ublas/matrix_proxy.hpp>
    

    are header-only: they consist entirely of header files containing templates and inline functions, and require no separately-compiled library binaries or special treatment when linking (source).

    However, there are other Boost libraries (like Boost.Filesystem) that must by compiled.