2

I have started adding OpenSL ES code to my Dynamic Shared Library project, but when I try to compile it, linker says:

undefined reference to 'slCreateEngine'

I can see OpenSLES.h in "External Dependencies", but linker cannot see it somehow. This is the code:

#include "Processing.h"
#include <SLES/OpenSLES.h>
#include <SLES/OpenSLES_Android.h>

extern "C" {
    int Java_com_example_Android_MainPageViewModel_GetValue()
    {
        SLObjectItf engine_obj;
        slCreateEngine(&engine_obj, 0, NULL, 0, NULL, NULL);

        return 42;
    }
}

How can I add NDK library to Dynamic Shared Library project in Visual Studio?

FCin
  • 3,804
  • 4
  • 20
  • 49

0 Answers0