POCO C + + 라 이브 러 리 가 Android 플랫폼 에 통합 (2)

전재 원본 주소:http://blog.csdn.net/iflychenyang/article/details/8534341
불행 하 게 도 mac os 에서 컴 파일 된 poco 정적 라 이브 러 리 입 니 다. 컴 파일 을 통합 하 는 중 오류 가 발생 했 습 니 다. 끝 파일 (ndk - build error: string: No such file or directory) 을 찾 을 수 없습니다. 표준 라 이브 러 리 가 컴 파일 되 지 않 았 을 것 입 니 다. 오늘 은 android. mk 파일 을 직접 작성 하여 다시 컴 파일 했 습 니 다. 현재 Foundation 라 이브 러 리 를 컴 파일 할 수 있 습 니 다. 먼저 스 크 립 트 를 여기에 두 고 나중에 볼 수
POCO 컴 파일 관련 스 크 립 트:
#
# Android.mk
#
# POCO Foundation
#
# create by: yangchen (  )
#

LOCAL_PATH       := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE     := PocoFoundation

LOCAL_CFLAGS     := -DPOCO_ANDROID -DPOCO_NO_FPENVIRONMENT -DPOCO_NO_WSTRING -DPOCO_NO_SHAREDMEMORY
LOCAL_CPPFLAGS   := -frtti -fexceptions

LOCAL_C_INCLUDES := $(LOCAL_PATH)/include \									

	$(LOCAL_PATH)/src \

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

include $(BUILD_SHARED_LIBRARY)
#
# Application.mk
#
# POCO Foundation
#
# create by: yangchen (  )
#

APP_CFLAGS += -fexceptions 
APP_STL := gnustl_static

POCO 통합 관련 스 크 립 트 및 테스트 코드:
#
# Application.mk
#
# POCO Foundation     
#
# create by: yangchen (  )
#

LOCAL_PATH :=$(call my-dir)

include $(CLEAR_VARS)

LOCAL_CFLAGS += -I$(LOCAL_PATH)/include
LOCAL_CPPFLAGS := -frtti -fexceptions

LOCAL_C_INCLUDES := $(LOCAL_PATH)

LOCAL_MODULE := BlcCore-jni

LOCAL_LDLIBS := -L$(LOCAL_PATH)/lib -lPocoFoundation -llog 

LOCAL_SRC_FILES := \
	TestClass.cpp \
	TestClassImpl.cpp

include $(BUILD_SHARED_LIBRARY)
#
# Application.mk
#
# POCO Foundation     
#
# create by: yangchen (  )
#

APP_CFLAGS += -fexceptions 
APP_STL := gnustl_static
// TestClass.h
#ifndef CORE_TEST_CLASS_INCLUDED
#define CORE_TEST_CLASS_INCLUDED

namespace YANGCHEN
{
	class TestClassImpl;

	class TestClass
	{
	public:
		TestClass(void);
		~TestClass(void);

		int year() const;

	private:
		TestClassImpl* pImpl;
	};
}

#endif
// TestClass.cpp
#include "TestClass.h"
#include "TestClassImpl.h"

namespace YANGCHEN
{
	TestClass::TestClass(void)
		: pImpl(new TestClassImpl)
	{
	}


	TestClass::~TestClass(void)
	{
		delete pImpl;
	}

	int TestClass::year() const
	{
		return pImpl->year();
	}
}
// TestClassImp.h
#ifndef CORE_TEST_CLASS_IMPL_INCLUDED
#define CORE_TEST_CLASS_IMPL_INCLUDED

#include "Poco/DateTime.h"

namespace YANGCHEN
{
	class TestClassImpl
	{
	public:
		TestClassImpl(void);
		~TestClassImpl(void);

		int year() const
		{
			return dt.year();
		}

	private:
		Poco::DateTime dt;
	};
}

#endif
// TestClassImp.cpp
#include "TestClassImpl.h"

namespace YANGCHEN
{
	TestClassImpl::TestClassImpl(void)
	{
	}


	TestClassImpl::~TestClassImpl(void)
	{
	}
}

좋은 웹페이지 즐겨찾기