Should I Compile Required Files Or Just Include them?

126 views Asked by At

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.

2

There are 2 answers

0
cpp On BEST ANSWER

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.

0
Paul Evans On

The fact that your program builds and runs means that you haven't missed any compilation/linkage steps. The Boost headers in particular don't usually require any executables. It's most likely a bug in your code that's causing this problem.