Basic includes

9 views
Skip to first unread message

Dan F

unread,
Jul 14, 2010, 9:09:13 PM7/14/10
to android-ndk
I'm trying to build a project off of some previously created C++
files. In those there is a moderately complex file hierarchy. Before
I can even hope to deal with that hierarchy from within the Android.mk
file I would need to grasp the basics of these files. So I have a
simple class that depends on two headers. Right now the file
structure I'm trying to utilize is like this:

jni
baseclass.cpp
Engine
Core
baseclass.h
defines.h

When I try to compile, my Android.mk is unable to find the two
headers. I have tried adding the line:
LOCAL_C_INCLUDES := $(LOCAL_PATH)/Engine/Core

with little success.

This is the most basic example of the kind of file structure that I
want to deal with. Ultimately I would like to have the Android.mk
file(s) point to the source in the regular directory, rather than
pulling them over one at a time.

Onur Cinar

unread,
Jul 15, 2010, 1:14:48 AM7/15/10
to andro...@googlegroups.com
Hi Dan,

Yes, LOCAL_C_INCLUDES is the right variable, however, looks like there is something else going wrong with the Android.mk.  Assuming that it is not too big,  could you post it the Android.mk as well so that we can take a look?

Regards,

-onur


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


---
www.zdo.com

Dan F

unread,
Jul 15, 2010, 1:09:52 PM7/15/10
to android-ndk
Here's my Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := Engine_Core
LOCAL_C_INCLIDES := $(LOCAL_PATH)/Engine/core
LOCAL_SRC_FILES := baseclass.cpp

include $(BUILD_SHARED_LIBRARY)

At the top of baseclass.cpp I have

#include "baseclass.h
#include "defines.h"

And when I try to build with this makefile the compiler cannot locate
these headers
> > android-ndk...@googlegroups.com<android-ndk%2Bunsu...@googlegroups.com>
> > .

Onur Cinar

unread,
Jul 15, 2010, 1:18:35 PM7/15/10
to andro...@googlegroups.com

Hi Dan,

Is LOCAL_C_INCLIDES  a typo?
                        
-onur

To unsubscribe from this group, send email to android-ndk...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


---
www.zdo.com

Doug Schaefer

unread,
Jul 15, 2010, 1:19:28 PM7/15/10
to andro...@googlegroups.com
Uh, assuming you cut and pasted this, you spelled INCLUDES wrong.

> To unsubscribe from this group, send email to android-ndk...@googlegroups.com.

Onur Cinar

unread,
Jul 15, 2010, 1:23:22 PM7/15/10
to andro...@googlegroups.com

Hi Dan,

I just did a quick test here,  and your Android.mk file, with LOCAL_C_INCLUDES fixed, worked fine:

cinar@linux-raln:~/bin/android-ndk-r4/apps/dan> ndk-build
Compile++ thumb: Engine_Core <= /home/cinar/bin/android-ndk-r4/apps/dan/jni/baseclass.cpp
In file included from /home/cinar/bin/android-ndk-r4/apps/dan/jni/baseclass.cpp:2:
/home/cinar/bin/android-ndk-r4/apps/dan/jni/Engine/core/baseclass.h:2:2: warning: #warning baseclass.h is now included
In file included from /home/cinar/bin/android-ndk-r4/apps/dan/jni/baseclass.cpp:3:
/home/cinar/bin/android-ndk-r4/apps/dan/jni/Engine/core/defines.h:2:2: warning: #warning defines.h is now included
SharedLibrary  : libEngine_Core.so
Install        : libEngine_Core.so => /home/cinar/bin/android-ndk-r4/apps/dan/libs/armeabi

I put some warning to make sure that the header files are included. I'm attaching it to this e-mail in case you would like to take a look.

Regards,

-onur

On Thu, Jul 15, 2010 at 10:09 AM, Dan F <dan.fe...@gmail.com> wrote:
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


---
www.zdo.com

dan.zip

Dan F

unread,
Jul 15, 2010, 4:48:43 PM7/15/10
to android-ndk
Wow do I feel silly for that not working... Thats the second time so
far Ive had this not work from a typo

On Jul 15, 10:23 am, Onur Cinar <onur.ci...@gmail.com> wrote:
> Hi Dan,
>
> > <android-ndk%2Bunsu...@googlegroups.com<android-ndk%252Buns...@googlegroups.com>
>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/android-ndk?hl=en.
>
> > > ---www.zdo.com
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "android-ndk" group.
> > To post to this group, send email to andro...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > android-ndk...@googlegroups.com<android-ndk%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/android-ndk?hl=en.
>
> ---www.zdo.com
>
>  dan.zip
> 2KViewDownload

Onur Cinar

unread,
Jul 15, 2010, 4:55:51 PM7/15/10
to andro...@googlegroups.com

Hi Dan,

Yes, makefiles can be tricky sometimes, and noticing the typos are mostly through. The way I usually troubleshoot these, is by adding the V=1 argument to ndk-build (or make) to get Android NDK to display the arguments that got down to GCC.  It mostly helps finding out typos and other issues easily.

Regards,

-onur

To unsubscribe from this group, send email to android-ndk...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


---
www.zdo.com

Reply all
Reply to author
Forward
0 new messages