Android Project made me crazy T_T help me

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
Post Reply
juckerpp
Gnoblar
Posts: 8
Joined: Thu Jan 31, 2013 5:01 am

Android Project made me crazy T_T help me

Post by juckerpp » Wed Mar 06, 2013 4:59 am

I use g++ make a STATIC lib for Ogre [libOgre.a] , this file is already Generate sucess.

then I create .MK file like this , I want link this libOgre.a , but there is always errors on freeImage, this is error text

Code: Select all

**** Clean-only build of configuration Default for project OgreClient ****

D:\cygwin\bin\bash --login -c cd D:/project/hg/3d/OgreClient/platform/AndroidClient && ndk-build -j4 NDKDEBUG=1 clean 
cygwin warning:
  MS-DOS style path detected: D:\project\hg\3d\OgreClient\platform\AndroidClient
  Preferred POSIX equivalent is: /cygdrive/d/project/hg/3d/OgreClient/platform/AndroidClient
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Compile++ thumb  : OgreClient <= main_jni.cpp
Compile++ thumb  : OgreClient <= OgreInstance.cpp
Compile++ thumb  : OgreClient <= OgreApp1.cpp
Compile++ thumb  : OgreClient <= BaseApplication.cpp
SharedLibrary  : libOgreClient.so
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(J2KHelper.o): in function FIBITMAPToJ2KImage(int, FIBITMAP*, opj_cparameters const*):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/FreeImage/J2KHelper.cpp:393: error: undefined reference to 'opj_image_create'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(J2KHelper.o): in function FIBITMAPToJ2KImage(int, FIBITMAP*, opj_cparameters const*):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/FreeImage/J2KHelper.cpp:489: error: undefined reference to 'opj_image_destroy'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(ToneMapping.o): in function FreeImage_ToneMapping:jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/FreeImage/ToneMapping.cpp:46: error: undefined reference to 'FreeImage_TmoDrago03'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(ToneMapping.o): in function FreeImage_ToneMapping:jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/FreeImage/ToneMapping.cpp:56: error: undefined reference to 'FreeImage_TmoReinhard05'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(ToneMapping.o): in function FreeImage_ToneMapping:jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/FreeImage/ToneMapping.cpp:66: error: undefined reference to 'FreeImage_TmoFattal02'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function _XTIFFDefaultDirectory(tiff*):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:64: error: undefined reference to 'TIFFMergeFieldInfo'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function XTIFFInitialize():jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:99: error: undefined reference to 'TIFFSetTagExtender'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function tiff_read_geotiff_profile(tiff*, FIBITMAP*):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:121: error: undefined reference to 'TIFFGetField'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function tiff_read_geotiff_profile(tiff*, FIBITMAP*):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:144: error: undefined reference to 'TIFFGetField'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function tiff_write_geotiff_profile(tiff*, FIBITMAP*):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:188: error: undefined reference to 'TIFFSetField'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function tiff_write_geotiff_profile(tiff*, FIBITMAP*):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:190: error: undefined reference to 'TIFFSetField'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function tiff_read_exif_tag(tiff*, TagLib::MDMODEL, FIBITMAP*, TagLib&, TIFFDirectory*, unsigned int):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:215: error: undefined reference to 'TIFFFieldWithTag'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function tiff_read_exif_tag(tiff*, TagLib::MDMODEL, FIBITMAP*, TagLib&, TIFFDirectory*, unsigned int):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:222: error: undefined reference to 'TIFFGetField'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function tiff_read_exif_tag(tiff*, TagLib::MDMODEL, FIBITMAP*, TagLib&, TIFFDirectory*, unsigned int):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:225: error: undefined reference to 'TIFFGetField'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function tiff_read_exif_tag(tiff*, TagLib::MDMODEL, FIBITMAP*, TagLib&, TIFFDirectory*, unsigned int):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:242: error: undefined reference to '_TIFFDataSize'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function tiff_read_exif_tag(tiff*, TagLib::MDMODEL, FIBITMAP*, TagLib&, TIFFDirectory*, unsigned int):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:242: error: undefined reference to '_TIFFmalloc'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function tiff_read_exif_tag(tiff*, TagLib::MDMODEL, FIBITMAP*, TagLib&, TIFFDirectory*, unsigned int):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:245: error: undefined reference to '_TIFFfree'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function tiff_read_exif_tag(tiff*, TagLib::MDMODEL, FIBITMAP*, TagLib&, TIFFDirectory*, unsigned int):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:255: error: undefined reference to '_TIFFfree'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function tiff_read_exif_tag(tiff*, TagLib::MDMODEL, FIBITMAP*, TagLib&, TIFFDirectory*, unsigned int):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:348: error: undefined reference to 'TIFFDataWidth'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function tiff_read_exif_tag(tiff*, TagLib::MDMODEL, FIBITMAP*, TagLib&, TIFFDirectory*, unsigned int):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:364: error: undefined reference to 'TIFFDataWidth'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function tiff_read_exif_tag(tiff*, TagLib::MDMODEL, FIBITMAP*, TagLib&, TIFFDirectory*, unsigned int):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:391: error: undefined reference to '_TIFFfree'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function tiff_read_exif_tags(tiff*, TagLib::MDMODEL, FIBITMAP*):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:406: error: undefined reference to 'TIFFGetTagListCount'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(XTIFF.o): in function tiff_read_exif_tags(tiff*, TagLib::MDMODEL, FIBITMAP*):jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata/XTIFF.cpp:408: error: undefined reference to 'TIFFGetTagListEntry'
D:/Envirment/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libfreeimage.a(MultigridPoissonSolver.o): in function FreeImage_MultigridPoissonSolver:jni/../..//Android/jni/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/FreeImageToolkit/MultigridPoissonSolver.cpp:494: error: undefined reference to 'NormalizeY'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libOgreClient.so] Error 1

**** Build Finished ****

this is my Android.mk file

Code: Select all

# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
LOCAL_PATH := $(call my-dir)


include $(CLEAR_VARS)
LOCAL_MODULE        := OgreClient
LOCAL_C_INCLUDES	:= \
	 $(LOCAL_PATH)/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source\
 	 $(LOCAL_PATH)/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/Metadata\
	 $(LOCAL_PATH)/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source/DeprecationManager\
	 $(LOCAL_PATH)/../../../../ogre/OgreMain/include\
	 $(LOCAL_PATH)/../../../../ogre/OgreMain/include/Android\
	 $(LOCAL_PATH)/../../../../ogre/OgreMain/src/nedmalloc\
	 $(LOCAL_PATH)/../../../../ogre/Samples/Browser/include\
	 $(LOCAL_PATH)/../../../../ogre/Samples/Common/include\
	 $(LOCAL_PATH)/../../../../ogre/Dependencies/src/FreeImage-3.13.1/Source\
	 $(LOCAL_PATH)/../../../../ogre/Dependencies/include\
	 $(LOCAL_PATH)/../../../../ogre/Dependencies/src/zziplib-0.13.57\
	 $(LOCAL_PATH)/../../../../ogre/Dependencies/src/boost_1_52_0\
	 $(LOCAL_PATH)/../../../../ogre/Components/RTShaderSystem/include\
	 $(LOCAL_PATH)/../../../../ogre/Components/Overlay/include\
	 $(LOCAL_PATH)/../../../../ogre/Components/Terrain/include\
	 $(LOCAL_PATH)/../../../../ogre/Components/Paging/include\
	 $(LOCAL_PATH)/../../../../ogre/RenderSystems/GLES2/include\
	 $(LOCAL_PATH)/../../../../ogre/RenderSystems/GLES2/include/EGL/Android\
	 $(LOCAL_PATH)/../../../../ogre/RenderSystems/GLES2/include/EGL\
	 $(LOCAL_PATH)/../../../../ogre/RenderSystems/GLES2/src/GLSLES/include\
	 $(LOCAL_PATH)/../../../../ogre/RenderSystems/GLES2/src/StateCacheManager\
	 $(LOCAL_PATH)/../../../../ogre/Plugins/ParticleFX/include\


LOCAL_SRC_FILES		:=\
	main_jni.cpp\
	src/OgreInstance.cpp\
	src/OgreApp1.cpp\
	src/BaseApplication.cpp\

LOCAL_CFLAGS		:= -DFREEIMAGE_LIB=1 -DOGRE_NONCLIENT_BUILD=1 -Werror -g
LOCAL_LDLIBS		:= -ldl -llog -lz 
LOCAL_LDLIBS    	+= -landroid -lGLESv2 -lEGL 





LOCAL_WHOLE_STATIC_LIBRARIES := libzzip
LOCAL_WHOLE_STATIC_LIBRARIES += libfreeimage
LOCAL_WHOLE_STATIC_LIBRARIES += cpufeatures
LOCAL_WHOLE_STATIC_LIBRARIES += libfreetype
LOCAL_WHOLE_STATIC_LIBRARIES += GLESv2
LOCAL_WHOLE_STATIC_LIBRARIES += Ogre_Static

include $(BUILD_SHARED_LIBRARY)
$(call import-add-path,$(LOCAL_PATH)/../../)
$(call import-module,android/cpufeatures)
$(call import-module,Android/jni)



I dont know how to fix it , the error info told me like miss link some lib, but the freeimage lib is already exist,
this problem take me 12 hour +
please help me...
0 x

juckerpp
Gnoblar
Posts: 8
Joined: Thu Jan 31, 2013 5:01 am

Re: Android Project made me crazy T_T help me

Post by juckerpp » Wed Mar 06, 2013 8:59 am

Fix it

solotion:

change Android.mk file

Code: Select all

LOCAL_CFLAGS		:= -DFREEIMAGE_LIB=1 -DOGRE_NONCLIENT_BUILD=1 -Werror -g
LOCAL_LDLIBS		:= -ldl -llog -lz 
LOCAL_LDLIBS    	+= -landroid -lGLESv2 -lEGL 

LOCAL_STATIC_LIBRARIES := Ogre_Static libzzip libfreeimage cpufeatures libfreetype

#LOCAL_WHOLE_STATIC_LIBRARIES := libzzip
#LOCAL_WHOLE_STATIC_LIBRARIES += libfreeimage
#LOCAL_WHOLE_STATIC_LIBRARIES += cpufeatures
#LOCAL_WHOLE_STATIC_LIBRARIES += libfreetype
#LOCAL_WHOLE_STATIC_LIBRARIES += libGLESv2
#LOCAL_WHOLE_STATIC_LIBRARIES += Ogre_Static
0 x

Post Reply