Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/188.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何将OpenSL ES库作为依赖项添加到项目中?_Android_C++_Visual Studio_Opensl - Fatal编程技术网

Android 如何将OpenSL ES库作为依赖项添加到项目中?

Android 如何将OpenSL ES库作为依赖项添加到项目中?,android,c++,visual-studio,opensl,Android,C++,Visual Studio,Opensl,我已经开始将OpenSL ES代码添加到我的动态共享库项目中,但当我尝试编译它时,linker说: undefined reference to 'slCreateEngine' 我可以在“外部依赖项”中看到OpenSLES.h,但链接器不知何故无法看到它。代码如下: #include "Processing.h" #include <SLES/OpenSLES.h> #include <SLES/OpenSLES_Android.h> extern "C" {

我已经开始将OpenSL ES代码添加到我的动态共享库项目中,但当我尝试编译它时,linker说:

undefined reference to 'slCreateEngine'
我可以在“外部依赖项”中看到
OpenSLES.h
,但链接器不知何故无法看到它。代码如下:

#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;
    }
}
#包括“Processing.h”
#包括
#包括
外部“C”{
int Java_com_示例_Android_MainPageViewModel_GetValue()
{
SLOBJECTF发动机;
slCreateEngine(&engine_obj,0,NULL,0,NULL,NULL);
返回42;
}
}
如何将NDK库添加到Visual Studio中的动态共享库项目中