Android NDK错误没有eclipse中存在的路径的此类文件或目录

时间:2012-10-15 05:59:17

标签: android eclipse android-ndk native

我在eclipse中收到以下错误:

**** Build of configuration Default for project com.opera.sdk.Opera ****

D:\android-ndk-r8b-windows\android-ndk-r8b\ndk-build.cmd all 
"Compile++ thumb : operanative <= main.cpp

In file included from jni/src/main.cpp:4:0:
jni/include/controller.hpp:6:28: fatal error: gogi_opera_api.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi/objs/operanative/src/main.o] Error 1

**** Build Finished ****

这是我的Android.mk makefile:

MY_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_PATH := $(MY_PATH)
LOCAL_MODULE    := libopera
LOCAL_SRC_FILES := libopera.a
include $(PREBUILT_STATIC_LIBRARY)

# final library
include $(CLEAR_VARS)
LOCAL_PATH := $(MY_PATH)
LOCAL_MODULE     := operanative
LOCAL_SRC_FILES  := src/main.cpp \
                    src/controller.cpp \
                    src/lock.cpp \
                    src/event.cpp \
                    src/dialog.cpp \
                    src/queue.cpp \
                    src/screen.cpp \
                    src/surface.cpp \
                    src/timer.cpp \
                    src/waiter.cpp \
                    src/window.cpp
LOCAL_C_INCLUDES := jni/include \
                    $(GOGI_SDK_PATH)/include \
                    $(GOGI_SDK_PATH)/jsplugins/ooif/include
LOCAL_WHOLE_STATIC_LIBRARIES := libopera
LOCAL_LDLIBS := -llog -ljnigraphics
include $(BUILD_SHARED_LIBRARY)

这是我的Application.mk文件:

APP_STL:=stlport_static
APP_ABI := armeabi armeabi-v7a
APP_PLATFORM := android-14

在questiuon中的controller.hpp文件中有以下定义:

#ifndef CONTROLLER_HPP
#define CONTROLLER_HPP

#include <memory>

#include "gogi_opera_api.h"

#include "event.hpp"
#include "dialog.hpp"
#include "queue.hpp"
#include "screen.hpp"
#include "surface.hpp"
#include "timer.hpp"
#include "waiter.hpp"
#include "window.hpp"

我将文件放在适当的位置,并根据需要重写了application.mk,但是我得到了上面的构建错误。我希望有人能够阐明这一点。 提前谢谢!

1 个答案:

答案 0 :(得分:0)

将* .hpp更改为* .cpp

它在echoprint项目中为我工作。我希望它对你也有用。

谢谢