How to include <android/bitmap.h> and other *.h NDK libraries to Titanium Android module?

I am facing problem in including built in NDK libraries such as (bitmap.h , log.h and others) to my Native C++ Code of Titanium android Module . problem as show in following figure . alt text

In Figure when i add any library such as #include<android/bitmap.h> as show above picture ,A little yellow Question mark appear on the left side which means "Unresolved inclusion" .How to Fix it ?

NOTE : As this problem can be fix in eclipse android project but i am unable to solve this issue in Titanium android Module project

One solution which i found on Internet is to mention graphics libraries to Android.mk file as show below :

LOCAL_PATH := $(call my-dir)
 
include $(CLEAR_VARS)
 
LOCAL_MODULE    := IMGprocessing
LOCAL_SRC_FILES := IMGprocessing.cpp
 
LOCAL_LDLIBS := -ljnigraphics
include $(BUILD_SHARED_LIBRARY)
BUT still i am getting Error Messages That "<android/bitmap.h> there is no such file or directory " when i Build my android Titanium module through Ant after successfully compile my Native C++ Code through cygwin to generated binaries ... Error messages are as shown below :
[exec] "Compile++ thumb : IMGprocessing <= IMGprocessing.cpp
     [exec] jni/IMGprocessing.cpp:4:28: error: android/bitmap.h: No such file or
 directory
     [exec] jni/IMGprocessing.cpp:9:12: warning: missing whitespace after the ma
cro name
     [exec] jni/IMGprocessing.cpp: In function 'void Java_com_nextin_imagemanipu
lation_ImageProcessing_HistogramEqualization(JNIEnv*, _jobject*, _jobject*, _job
ject*)':
     [exec] jni/IMGprocessing.cpp:20: error: 'AndroidBitmapInfo' was not declare
d in this scope
     [exec] jni/IMGprocessing.cpp:20: error: expected ';' before 'info_orignal'
     [exec] jni/IMGprocessing.cpp:22: error: expected ';' before 'info_new'
     [exec] jni/IMGprocessing.cpp:27: error: 'uint32_t' was not declared in this
 scope
     [exec] jni/IMGprocessing.cpp:27: error: 'line_orignal' was not declared in
this scope
     [exec] jni/IMGprocessing.cpp:28: error: 'line_new' was not declared in this
 scope
     [exec] jni/IMGprocessing.cpp:33: error: 'info_orignal' was not declared in
this scope
     [exec] jni/IMGprocessing.cpp:33: error: 'AndroidBitmap_getInfo' was not dec
lared in this scope
     [exec] jni/IMGprocessing.cpp:38: error: 'info_orignal' was not declared in
this scope
     [exec] jni/IMGprocessing.cpp:38: error: 'ANDROID_BITMAP_FORMAT_RGBA_8888' w
as not declared in this scope
     [exec] jni/IMGprocessing.cpp:42: error: 'AndroidBitmap_lockPixels' was not
declared in this scope
     [exec] jni/IMGprocessing.cpp:46: error: 'info_new' was not declared in this
 scope
     [exec] jni/IMGprocessing.cpp:46: error: 'AndroidBitmap_getInfo' was not dec
lared in this scope
     [exec] jni/IMGprocessing.cpp:51: error: 'info_new' was not declared in this
 scope
     [exec] jni/IMGprocessing.cpp:51: error: 'ANDROID_BITMAP_FORMAT_RGBA_8888' w
as not declared in this scope
     [exec] jni/IMGprocessing.cpp:55: error: 'AndroidBitmap_lockPixels' was not
declared in this scope
     [exec] jni/IMGprocessing.cpp:60: error: 'AndroidBitmap_unlockPixels' was no
t declared in this scope
     [exec] jni/IMGprocessing.cpp:66: error: 'info_orignal' was not declared in
this scope
     [exec] jni/IMGprocessing.cpp:67: error: expected primary-expression before
')' token
     [exec] jni/IMGprocessing.cpp:67: error: expected ';' before 'pixels_orignal
'
     [exec] jni/IMGprocessing.cpp:94: error: 'info_orignal' was not declared in
this scope
     [exec] jni/IMGprocessing.cpp:139: error: 'AndroidBitmap_lockPixels' was not
 declared in this scope
     [exec] jni/IMGprocessing.cpp:144: error: expected primary-expression before
 ')' token
     [exec] jni/IMGprocessing.cpp:144: error: expected ';' before 'pixels_origna
l'
     [exec] jni/IMGprocessing.cpp:145: error: expected primary-expression before
 ')' token
     [exec] jni/IMGprocessing.cpp:145: error: expected ';' before 'pixels_new'
     [exec] jni/IMGprocessing.cpp:164: error: 'info_new' was not declared in thi
s scope
     [exec] jni/IMGprocessing.cpp:172: error: 'AndroidBitmap_lockPixels' was not
 declared in this scope
     [exec] make: *** [C:\Users\Haris\AppData\Local\Temp\/Haris/imagemanipulatio
n-generated/obj/local/armeabi/objs/IMGprocessing/IMGprocessing.o] Error 1
     [move] Moving 4 files to D:\Nextin_Company_Workspace\Workspace_Titanium\Ima
geManipulation\build\generated\jni-local
 
BUILD FAILED
C:\Users\Haris\AppData\Roaming\Titanium\mobilesdk\win32\3.0.2.GA\module\android\
build.xml:410: D:\Nextin_Company_Workspace\Workspace_Titanium\ImageManipulation\
build\generated\jni-local\libs does not exist.
 
Total time: 26 seconds
Please Help me out .. Thanks in advance .

My Environment Details are as follow:

Windows 8 64bit Professional Titanium Studio, build: 3.0.1 Python27 apache-ant-1.8.4

— asked 10 months ago by  Muhammad Haris Baig
1 Comment
  • >NOTE : As this problem can be fix in eclipse android project but i am unable to solve this issue in Titanium android Module project

    How do you fix this in Eclipse Android ?

    — commented 10 months ago by Francois Stephany

1 Answer

0

SOLVED : i got the solution that how can i fix this issue in Titanium studio with Native module development.. just go to NDK Project->New->Folder->Advanced->Link to alternate location(Linked Folder) Browse the path?for example)?C:\Android\android-ndk-r8b\platforms\android-8\arch-arm\usr\include

and then click ok !! This will fix unresolved inclusion Problem :)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值