Overview
Features
Download
Documentation
Community
Add-Ons & Services

Building for Android Problems

Please post support and help requests here.

Building for Android Problems

Postby brentdunham » 13 Sep 2012, 04:35

Using NDK - r8b,
I created a standalone toolchain, added the bin folder of that toolchain to my PATH.
ran
./configure --config=Android --no-samples --no-tests
make -j4

Here's the info from the first compile error:
** Compiling src/ASCIIEncoding.cpp (debug, static)
arm-linux-androideabi-g++ -Iinclude -I/common/poco-1.4.4-all/CppUnit/include -I/common/poco-1.4.4-all/Foundation/include -I/common/poco-1.4.4-all/XML/include -I/common/poco-1.4.4-all/Util/include -I/common/poco-1.4.4-all/Net/include -I/common/poco-1.4.4-all/Crypto/include -I/common/poco-1.4.4-all/NetSSL_OpenSSL/include -I/common/poco-1.4.4-all/Data/include -I/common/poco-1.4.4-all/Data/SQLite/include -I/common/poco-1.4.4-all/Data/ODBC/include -I/common/poco-1.4.4-all/Data/MySQL/include -I/common/poco-1.4.4-all/Zip/include -I/common/poco-1.4.4-all/PageCompiler/include -I/common/poco-1.4.4-all/PageCompiler/File2Page/include -mthumb -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -frtti -fexceptions -DPOCO_BUILD_HOST=unknown14109fcff0b7 -DPOCO_ANDROID -DPOCO_NO_FPENVIRONMENT -DPOCO_NO_WSTRING -DPOCO_NO_SHAREDMEMORY -g -D_DEBUG -c src/AsyncChannel.cpp -o /common/poco-1.4.4-all/Foundation/obj/Android/armeabi/debug_static/AsyncChannel.o
arm-linux-androideabi-g++ -Iinclude -I/common/poco-1.4.4-all/CppUnit/include -I/common/poco-1.4.4-all/Foundation/include -I/common/poco-1.4.4-all/XML/include -I/common/poco-1.4.4-all/Util/include -I/common/poco-1.4.4-all/Net/include -I/common/poco-1.4.4-all/Crypto/include -I/common/poco-1.4.4-all/NetSSL_OpenSSL/include -I/common/poco-1.4.4-all/Data/include -I/common/poco-1.4.4-all/Data/SQLite/include -I/common/poco-1.4.4-all/Data/ODBC/include -I/common/poco-1.4.4-all/Data/MySQL/include -I/common/poco-1.4.4-all/Zip/include -I/common/poco-1.4.4-all/PageCompiler/include -I/common/poco-1.4.4-all/PageCompiler/File2Page/include -mthumb -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64 -frtti -fexceptions -DPOCO_BUILD_HOST=unknown14109fcff0b7 -DPOCO_ANDROID -DPOCO_NO_FPENVIRONMENT -DPOCO_NO_WSTRING -DPOCO_NO_SHAREDMEMORY -g -D_DEBUG -c src/ASCIIEncoding.cpp -o /common/poco-1.4.4-all/Foundation/obj/Android/armeabi/debug_static/ASCIIEncoding.o
In file included from include/Poco/Foundation.h:145:0,
from include/Poco/AsyncChannel.h:43,
from src/AsyncChannel.cpp:37:
include/Poco/Bugcheck.h:44:18: fatal error: string: No such file or directoryIn file included from include/Poco/Foundation.h:145:0,

Could anyone help me out on this?

I can confirm arm-linux-androideabi-g++ is the one in my custom toolchain's bin folder.
brentdunham
 
Posts: 1
Joined: 13 Sep 2012, 04:28

Re: Building for Android Problems

Postby RichardLee » 29 Oct 2012, 18:27

I an using android-ndk-r8b, and this is Android.mk file. See below:
Android.mk
#
# Android.mk
#
# POCO Foundation
#
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := PocoFoundation
SRC_PATH := src
LOCAL_CFLAGS := $(ECS_LIB_FLAGS)
LOCAL_CPPFLAGS := -frtti -fexceptions
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include

LOCAL_SRC_FILES := \
$(SRC_PATH)/ASCIIEncoding.cpp \
$(SRC_PATH)/AbstractObserver.cpp \
$(SRC_PATH)/ActiveDispatcher.cpp \
$(SRC_PATH)/ArchiveStrategy.cpp \
$(SRC_PATH)/Ascii.cpp \
$(SRC_PATH)/AsyncChannel.cpp \
$(SRC_PATH)/AtomicCounter.cpp \
$(SRC_PATH)/Base64Decoder.cpp \
$(SRC_PATH)/Base64Encoder.cpp \
$(SRC_PATH)/BinaryReader.cpp \
$(SRC_PATH)/BinaryWriter.cpp \
$(SRC_PATH)/Bugcheck.cpp \
$(SRC_PATH)/ByteOrder.cpp \
$(SRC_PATH)/Channel.cpp \
$(SRC_PATH)/Checksum.cpp \
$(SRC_PATH)/Condition.cpp \
$(SRC_PATH)/Configurable.cpp \
$(SRC_PATH)/ConsoleChannel.cpp \
$(SRC_PATH)/CountingStream.cpp \
$(SRC_PATH)/DateTime.cpp \
$(SRC_PATH)/DateTimeFormat.cpp \
$(SRC_PATH)/DateTimeFormatter.cpp \
$(SRC_PATH)/DateTimeParser.cpp \
$(SRC_PATH)/Debugger.cpp \
$(SRC_PATH)/DeflatingStream.cpp \
$(SRC_PATH)/DigestEngine.cpp \
$(SRC_PATH)/DigestStream.cpp \
$(SRC_PATH)/DirectoryIterator.cpp \
$(SRC_PATH)/DirectoryWatcher.cpp \
$(SRC_PATH)/DynamicAny.cpp \
$(SRC_PATH)/DynamicAnyHolder.cpp \
$(SRC_PATH)/Environment.cpp \
$(SRC_PATH)/ErrorHandler.cpp \
$(SRC_PATH)/Event.cpp \
$(SRC_PATH)/EventArgs.cpp \
$(SRC_PATH)/Exception.cpp \
$(SRC_PATH)/FPEnvironment.cpp \
$(SRC_PATH)/File.cpp \
$(SRC_PATH)/FileChannel.cpp \
$(SRC_PATH)/FileStream.cpp \
$(SRC_PATH)/FileStreamFactory.cpp \
$(SRC_PATH)/Format.cpp \
$(SRC_PATH)/Formatter.cpp \
$(SRC_PATH)/FormattingChannel.cpp \
$(SRC_PATH)/Glob.cpp \
$(SRC_PATH)/Hash.cpp \
$(SRC_PATH)/HashStatistic.cpp \
$(SRC_PATH)/HexBinaryDecoder.cpp \
$(SRC_PATH)/HexBinaryEncoder.cpp \
$(SRC_PATH)/InflatingStream.cpp \
$(SRC_PATH)/Latin1Encoding.cpp \
$(SRC_PATH)/Latin9Encoding.cpp \
$(SRC_PATH)/LineEndingConverter.cpp \
$(SRC_PATH)/LocalDateTime.cpp \
$(SRC_PATH)/LogFile.cpp \
$(SRC_PATH)/LogStream.cpp \
$(SRC_PATH)/Logger.cpp \
$(SRC_PATH)/LoggingFactory.cpp \
$(SRC_PATH)/LoggingRegistry.cpp \
$(SRC_PATH)/MD4Engine.cpp \
$(SRC_PATH)/MD5Engine.cpp \
$(SRC_PATH)/Manifest.cpp \
$(SRC_PATH)/MemoryPool.cpp \
$(SRC_PATH)/MemoryStream.cpp \
$(SRC_PATH)/Message.cpp \
$(SRC_PATH)/Mutex.cpp \
$(SRC_PATH)/NamedEvent.cpp \
$(SRC_PATH)/NamedMutex.cpp \
$(SRC_PATH)/NestedDiagnosticContext.cpp \
$(SRC_PATH)/Notification.cpp \
$(SRC_PATH)/NotificationCenter.cpp \
$(SRC_PATH)/NotificationQueue.cpp \
$(SRC_PATH)/NullChannel.cpp \
$(SRC_PATH)/NullStream.cpp \
$(SRC_PATH)/NumberFormatter.cpp \
$(SRC_PATH)/NumberParser.cpp \
$(SRC_PATH)/Path.cpp \
$(SRC_PATH)/PatternFormatter.cpp \
$(SRC_PATH)/Pipe.cpp \
$(SRC_PATH)/PipeImpl.cpp \
$(SRC_PATH)/PipeStream.cpp \
$(SRC_PATH)/PriorityNotificationQueue.cpp \
$(SRC_PATH)/Process.cpp \
$(SRC_PATH)/PurgeStrategy.cpp \
$(SRC_PATH)/RWLock.cpp \
$(SRC_PATH)/Random.cpp \
$(SRC_PATH)/RandomStream.cpp \
$(SRC_PATH)/RefCountedObject.cpp \
$(SRC_PATH)/RegularExpression.cpp \
$(SRC_PATH)/RotateStrategy.cpp \
$(SRC_PATH)/Runnable.cpp \
$(SRC_PATH)/SHA1Engine.cpp \
$(SRC_PATH)/Semaphore.cpp \
$(SRC_PATH)/SharedLibrary.cpp \
$(SRC_PATH)/SharedMemory.cpp \
$(SRC_PATH)/SignalHandler.cpp \
$(SRC_PATH)/SimpleFileChannel.cpp \
$(SRC_PATH)/SplitterChannel.cpp \
$(SRC_PATH)/Stopwatch.cpp \
$(SRC_PATH)/StreamChannel.cpp \
$(SRC_PATH)/StreamConverter.cpp \
$(SRC_PATH)/StreamCopier.cpp \
$(SRC_PATH)/StreamTokenizer.cpp \
$(SRC_PATH)/String.cpp \
$(SRC_PATH)/StringTokenizer.cpp \
$(SRC_PATH)/SynchronizedObject.cpp \
$(SRC_PATH)/SyslogChannel.cpp \
$(SRC_PATH)/Task.cpp \
$(SRC_PATH)/TaskManager.cpp \
$(SRC_PATH)/TaskNotification.cpp \
$(SRC_PATH)/TeeStream.cpp \
$(SRC_PATH)/TemporaryFile.cpp \
$(SRC_PATH)/TextBufferIterator.cpp \
$(SRC_PATH)/TextConverter.cpp \
$(SRC_PATH)/TextEncoding.cpp \
$(SRC_PATH)/TextIterator.cpp \
$(SRC_PATH)/Thread.cpp \
$(SRC_PATH)/ThreadLocal.cpp \
$(SRC_PATH)/ThreadPool.cpp \
$(SRC_PATH)/ThreadTarget.cpp \
$(SRC_PATH)/TimedNotificationQueue.cpp \
$(SRC_PATH)/Timer.cpp \
$(SRC_PATH)/Timespan.cpp \
$(SRC_PATH)/Timestamp.cpp \
$(SRC_PATH)/Timezone.cpp \
$(SRC_PATH)/Token.cpp \
$(SRC_PATH)/URI.cpp \
$(SRC_PATH)/URIStreamFactory.cpp \
$(SRC_PATH)/URIStreamOpener.cpp \
$(SRC_PATH)/UTF16Encoding.cpp \
$(SRC_PATH)/UTF8Encoding.cpp \
$(SRC_PATH)/UTF8String.cpp \
$(SRC_PATH)/UUID.cpp \
$(SRC_PATH)/UUIDGenerator.cpp \
$(SRC_PATH)/Unicode.cpp \
$(SRC_PATH)/UnicodeConverter.cpp \
$(SRC_PATH)/Void.cpp \
$(SRC_PATH)/Windows1252Encoding.cpp \
$(SRC_PATH)/adler32.c \
$(SRC_PATH)/compress.c \
$(SRC_PATH)/crc32.c \
$(SRC_PATH)/deflate.c \
$(SRC_PATH)/infback.c \
$(SRC_PATH)/inffast.c \
$(SRC_PATH)/inflate.c \
$(SRC_PATH)/inftrees.c \
$(SRC_PATH)/pcre_chartables.c \
$(SRC_PATH)/pcre_compile.c \
$(SRC_PATH)/pcre_exec.c \
$(SRC_PATH)/pcre_fullinfo.c \
$(SRC_PATH)/pcre_globals.c \
$(SRC_PATH)/pcre_maketables.c \
$(SRC_PATH)/pcre_newline.c \
$(SRC_PATH)/pcre_ord2utf8.c \
$(SRC_PATH)/pcre_study.c \
$(SRC_PATH)/pcre_tables.c \
$(SRC_PATH)/pcre_try_flipped.c \
$(SRC_PATH)/pcre_ucd.c \
$(SRC_PATH)/pcre_valid_utf8.c \
$(SRC_PATH)/pcre_xclass.c \
$(SRC_PATH)/trees.c \
$(SRC_PATH)/zutil.c

#include $(BUILD_STATIC_LIBRARY)
include $(BUILD_SHARED_LIBRARY)

Application.mk
#APP_BUILD_SCRIPT= := $(call my-dir)/project/build/Android.mk
APP_PLATFORM := android-8
#APP_OPTIM := debug
APP_OPTIM := release
APP_ABI := armeabi
#APP_ABI := armeabi-v7a
APP_STL := gnustl_static
#APP_STL := stlport_static

APP_MODULES := PocoFoundation

ECS_LIB_FLAGS := -DPOCO_ANDROID \
-DPOCO_NO_FPENVIRONMENT \
-DPOCO_NO_WSTRING \
-DPOCO_NO_SHAREDMEMORY
RichardLee
 
Posts: 1
Joined: 29 Oct 2012, 18:21

Re: Building for Android Problems

Postby guenter » 30 Oct 2012, 10:25

Is your PATH correct so that make picks up your custom toolchain's compiler instead of the default one (which does not support STL)?
guenter
 
Posts: 1117
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Building for Android Problems

Postby ahtoh » 30 Oct 2012, 14:59

I have built poco successfully with NDK r7, but with NDK r8b I had had the same problem before I found ugly but working workaround.

I don't fully understand your question
guenter wrote:Is your PATH correct so that make picks up your custom toolchain's compiler instead of the default one (which does not support STL)?

but first of all, I did the following steps from your post http://pocoproject.org/docs/99300-AndroidPlatformNotes.html:
    $NDK/build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=$HOME/android-toolchain
    export PATH=$PATH:$HOME/android-toolchain/bin
    ./configure --config=Android --no-samples --no-tests --include-path=/home/user/android-ssl/include --library-path=/home/user/android-ssl/lib
and this led to the same error as brentdunham got.

Then I reconfigured poco:
./configure --config=Android --no-samples --no-tests --include-path=/home/user/android-ssl/include,/home/user/android-toolchain/sysroot/usr/include,/home/user/android-toolchain/arm-linux-androideabi/include/c++/4.6,/home/user/android-toolchain/arm-linux-androideabi/include/c++/4.6/arm-linux-androideabi/thumb --library-path=/home/user/android-ssl/lib,/home/user/android-toolchain/sysroot/usr/lib,/home/user/android-toolchain/arm-linux-androideabi/lib/thumb
after all I built poco for armeabi architecture successfully, I had chosen thumb set of binaries and headers because in Android config for POCO for armeabi used -mthumb flag but I am not sure that this is right choice.

When I considered about rewriting Android config for POCO I found that in arm-linux-androideabi directories exists three different set of binaries and headers for: armv7-a, thumb and default set, but I didn't fully understand when thumb binaries and headers have to be used and when default binaries and headers, also I had to take into account x86 architecture and newest mips. So I didn't rewrite Android config.
ahtoh
 
Posts: 4
Joined: 10 Jun 2011, 13:28
Location: Russia

Re: Building for Android Problems

Postby Hitnrun » 01 Nov 2012, 15:58

I had this problem, it was because of a wrong directory name in the standalone toolchain, as in this bug report:

http://code.google.com/p/android/issues/detail?id=35279

Solution is:

# cd <yourstandalonetoolchain>/arm-linux-androideabi/include/c++
# mv 4.6 4.6.x-google
Hitnrun
 
Posts: 20
Joined: 01 Apr 2009, 18:32


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron