0
我正在開發一個Android NDK項目,並且我想使用libcurl庫從C++下載資源。我正在使用NDK的內置ndk-build工具。在生成過程中,我得到以下錯誤:在Android NDK中使用libcurl
Build command failed.
Error while executing process /Users/afarm/Library/Android/sdk/ndk-bundle/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/afarm/AndroidStudioProjects/NativeOpenGL/engine/Android.mk APP_ABI=armeabi NDK_ALL_ABIS=armeabi NDK_DEBUG=1 APP_PLATFORM=android-15 NDK_OUT=/Users/afarm/AndroidStudioProjects/NativeOpenGL/engine/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/Users/afarm/AndroidStudioProjects/NativeOpenGL/engine/build/intermediates/ndkBuild/debug/lib APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
Android NDK: /Users/afarm/AndroidStudioProjects/NativeOpenGL/engine/Android.mk: Cannot find module with tag 'libcurl' in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
Android NDK:
這裏是我的Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := engine-core
LOCAL_CFLAGS := -Wall -Wextra
APP_CPPFLAGS := -std=c++11
APP_STL := gnustl_static
NDK_TOOLCHAIN_VERSION := clang
LOCAL_SRC_FILES := src/main/cpp/rendererwrapper.cpp \
src/main/cpp/renderer.cpp \
src/main/cpp/ShaderProgram.cpp \
src/main/cpp/SimpleShaderProgram.cpp \
src/main/cpp/NativeOpenGLShaderPrograms.c
LOCAL_STATIC_LIBRARIES := libcurl
LOCAL_LDLIBS := -llog -lGLESv2 -landroid
include $(BUILD_SHARED_LIBRARY)
$(call import-add-path,src/main/cpp)
$(call import-module,libcurl)
我已經下載了捲曲/ libcurl的版本,把它在src /主/ CPP /目錄。我正在尋找一種將libcurl包含在項目中的方法。要清楚,我想使用官方的libcurl版本(不是移植版本)。