Eclipse/ADT/NDK Native Libraries Don't Build [message #642591] |
Wed, 01 December 2010 21:57 |
Paul Lamb Messages: 2 Registered: December 2010 |
Junior Member |
|
|
Hello, all. Sorry if this isn't the correct section to post, but I could not find a section related to Android plugins for Eclipse. I'm hoping that perhaps there are other Eclipse Android developers on here that might be able to help me out. Moderators, feel free to move this to a more appropriate section if there is one.
I'm still new to the NDK and Eclipse, so this is probably an easy question. I have source code for several libraries that I want to have built into libs/armeabi/libNAME.so. Reading the documentation, it seems like all I should have to do is put the libraries into individual folders under the jni folder, create an Android.mk file in jni which has a call to "include $(call all-subdir-makefiles)", and another Android.mk in the sub-folder which has a call to "include $(BUILD_SHARED_LIBRARY)" I think these files are correct, so I'm not sure what I'm missing to have Eclipse/NDK actually build the libraries.
For reference, the Android.mk file located in jni is:
# If SDL_Mixer should link to libMAD
SDL_MIXER_USE_LIBMAD :=
ifneq ($(strip $(filter mad, $(COMPILED_LIBRARIES))),)
SDL_MIXER_USE_LIBMAD := 1
endif
ifneq ($(findstring -crystax,$(TARGET_CC)),)
$(info Building with CrystaX toolchain - RTTI and exceptions enabled, STLPort disabled)
CRYSTAX_TOOLCHAIN=1
endif
include $(call all-subdir-makefiles)
And an example of an Android.mk file for one of the libraries, located in a sub-folder under jni:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := xml2
LOCAL_CFLAGS := -Os -I$(LOCAL_PATH) -I$(LOCAL_PATH)/include
LOCAL_CPP_EXTENSION := .cpp
LOCAL_SRC_FILES := \
SAX.c entities.c encoding.c error.c \
parserInternals.c parser.c tree.c hash.c list.c xmlIO.c \
xmlmemory.c uri.c valid.c xlink.c HTMLparser.c HTMLtree.c \
debugXML.c xpath.c xpointer.c xinclude.c nanohttp.c nanoftp.c \
DOCBparser.c catalog.c globals.c threads.c c14n.c xmlstring.c \
xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \
xmlreader.c relaxng.c dict.c SAX2.c xmlwriter.c legacy.c \
chvalid.c pattern.c xmlsave.c xmlmodule.c schematron.c \
triostr.c trio.c trionan.c
LOCAL_SHARED_LIBRARIES :=
LOCAL_STATIC_LIBRARIES :=
LOCAL_LDLIBS := -lz -ldl
include $(BUILD_SHARED_LIBRARY)
Let me know if you require any further information (sorry if I've left out something obvious).
|
|
|
|
Re: Eclipse/ADT/NDK Native Libraries Don't Build [message #642612 is a reply to message #642591] |
Thu, 02 December 2010 00:46 |
|
On 2010.12.01 14:58, Paul Lamb wrote:
> Hello, all. Sorry if this isn't the correct section to post, but I
> could not find a section related to Android plugins for Eclipse. I'm
> hoping that perhaps there are other Eclipse Android developers on here.
>
> [snip]
No, the Android SDK contains plug-ins for use with Eclipse and not the
other way around. For some forums, see:
http://www.javahotchocolate.com/tutorials/android.html#suppo rt
Yes, there are lots of us, but we refrain from too much Android
discussion because this isn't really the forum (and, as I say, there
isn't an Android forum at eclipse.org; the topic is very well covered by
other forums already).
There's a great tutorial that would have told you the answer to this at
http://www.vogella.de/articles/Android/article.html
Best of luck.
|
|
|
Powered by
FUDForum. Page generated in 0.05350 seconds