0

I am using the opus library in an Android project. I have successfully linked to the library and can use the opus_decode function. But even though Android Studio does not throw any errors, the opus_decode_float throws an undefined reference error when I try to make the project with a linker command failed messages.

I have refreshed the linked c/c++ files and restarted Android studio. Error still persists. Similar cases I have come across all mention linking/importing the header file where the opus_decode_float is defined but this is already imported as opus_decode which is defined in the same header file does not throw any linker errors.

Korogba
  • 105
  • 9
  • 5
    It seems you have to learn about the differences between *declarations* and *definitions*. Functions are usually only *declared* in header file, and *defined* in the actual library file (that you need to link with). – Some programmer dude Dec 15 '17 at 14:35
  • 1
    Fair enough. I just went in search of the implementation and from first check the failing function is not defined in the same file as the passing one. So that just might be it. – Korogba Dec 15 '17 at 14:47
  • @Someprogrammerdude Thanks! So my CMake file imports another build file that has some configurations set that disabled the function. Whew! Can't accept a comment as answer though. – Korogba Dec 15 '17 at 15:00

0 Answers0