Can';t在将Android/NDK项目转换为c+之后,使用CDT在Eclipse中构建它+;项目
我尝试构建项目示例。这是一个Android+NDK项目。当我通过shell使用NDK构建时,它工作得很好,但是后来我使用Eclipse CDT将项目转换为C++项目。现在我无法在Eclipse中构建它:Can';t在将Android/NDK项目转换为c+之后,使用CDT在Eclipse中构建它+;项目,android,eclipse,makefile,java-native-interface,android-ndk,Android,Eclipse,Makefile,Java Native Interface,Android Ndk,我尝试构建项目示例。这是一个Android+NDK项目。当我通过shell使用NDK构建时,它工作得很好,但是后来我使用Eclipse CDT将项目转换为C++项目。现在我无法在Eclipse中构建它: **** Build of configuration Default for project ImageTargets **** make all make: *** No rule to make target `all'. Stop. **** Build Finished ***
**** Build of configuration Default for project ImageTargets ****
make all
make: *** No rule to make target `all'. Stop.
**** Build Finished ****
这里是Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := QCAR-prebuilt
LOCAL_SRC_FILES = ../../../build/lib/$(TARGET_ARCH_ABI)/libQCAR.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../build/include
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := ImageTargets
TARGET_PLATFORM := android-5
USE_OPENGL_ES_1_1 := false
ifeq ($(USE_OPENGL_ES_1_1), true)
OPENGLES_LIB := -lGLESv1_CM
OPENGLES_DEF := -DUSE_OPENGL_ES_1_1
else
OPENGLES_LIB := -lGLESv2
OPENGLES_DEF := -DUSE_OPENGL_ES_2_0
endif
LOCAL_CFLAGS := -Wno-write-strings $(OPENGLES_DEF)
LOCAL_LDLIBS := \
-llog $(OPENGLES_LIB)
LOCAL_SHARED_LIBRARIES := QCAR-prebuilt
LOCAL_SRC_FILES := ImageTargets.cpp SampleUtils.cpp Texture.cpp
LOCAL_ARM_MODE := arm
include $(BUILD_SHARED_LIBRARY)
我试图创建自定义生成器,但没有任何帮助。
建筑商名单:
环境:
视窗7 32
GNU Make 3.82.90
g++3.4.4
android ndk r6
靛蓝蚀
谢谢你的帮助。谢谢。我记得我试过fastcv样本,并描述了该技术的工作原理。所以我浏览了一下,在项目的根目录中找到了另一个makefile。我已经将它添加到QCAR样本中,现在它似乎可以工作了。 我不熟悉makefile,但我认为关键在于将“all”定义为“ndk build”:
#
# Determine host system and architecture from the environment
# (Borrowed from NDK makefile "init.mk"
#
HOST_OS := $(strip $(HOST_OS))
ifndef HOST_OS
# On all modern variants of Windows (including Cygwin and Wine)
# the OS environment variable is defined to 'Windows_NT'
#
# The value of PROCESSOR_ARCHITECTURE will be x86 or AMD64
#
ifeq ($(OS),Windows_NT)
HOST_OS := windows
else
# For other systems, use the `uname` output
UNAME := $(shell uname -s)
ifneq (,$(findstring Linux,$(UNAME)))
HOST_OS := linux
endif
ifneq (,$(findstring Darwin,$(UNAME)))
HOST_OS := darwin
endif
# We should not be there, but just in case !
ifneq (,$(findstring CYGWIN,$(UNAME)))
HOST_OS := windows
endif
ifeq ($(HOST_OS),)
$(error Unable to determine HOST_OS from uname -s: $(UNAME))
$(error Please define HOST_OS in your environment.)
endif
endif
$(info Host OS was auto-detected: $(HOST_OS))
else
$(info Host OS from environment: $(HOST_OS))
endif
#
# Define function to fix path names to work with Make
#
ifeq ($(HOST_OS),windows)
fixpath = $(shell cygpath $(subst \,/,$(1)))
else
fixpath = $(1)
endif
# Fix working directory path for NDK tools
PWD := $(call fixpath,$(PWD))
# Fix Android NDK root path
ANDROID_NDK_ROOT := $(call fixpath,$(ANDROID_NDK_ROOT))
all:
@$(ANDROID_NDK_ROOT)ndk-build
clean:
@$(ANDROID_NDK_ROOT)ndk-build clean
转到窗口->首选项->Android->NDK