2013年9月3日 星期二

Poco with cocos2d in Android and Ios

//////////////build poco-1.4.4-all with Android NDK in Linux

root@ubuntu:~# /usr/local/android-ndk-r7-crystax-5.beta2/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=/usr/local/android-toolchain

//Poco build command line
#Need full path configure, Otherwise you'll get an error saying "Current working directory not under $PROJECT_BASE."

export PATH=$PATH:/usr/local/android-toolchain/bin
/root/poco-1.4.4-alllinux/configure --prefix=/usr/local/poco-1.4.4 --config=Android --no-samples --no-tests --omit=NetSSL_OpenSSL,Crypto,Data/ODBC,Data/MySQL,PageCompiler

make

make install


/////////////poco with Android cocos2d in Linux
CCMutableArray.h & CCSet.cpp
add #include

Application.mk
modify
APP_STL := stlport_static
to
APP_STL := gnustl_static

jni/[proj_name]/Android.mk
LOCAL_C_INCLUDES :=
add
/usr/local/poco-1.4.4/include

LOCAL_LDLIBS :=
add
-lgnustl_static

LOCAL_CFLAGS := -DPOCO_ANDROID -DPOCO_NO_FPENVIRONMENT -DPOCO_NO_WSTRING -DPOCO_NO_SHAREDMEMORY

LOCAL_LDFLAGS := /usr/local/poco-1.4.4/lib/libPocoUtild.a \
/usr/local/poco-1.4.4/lib/libPocoNetd.a \
/usr/local/poco-1.4.4/lib/libPocoFoundationd.a \
/usr/local/poco-1.4.4/lib/libPocoXMLd.a \
/usr/local/poco-1.4.4/lib/libPocoDataSQLited.a

///////////////build poco-1.4.4-all with win32
modify build_vs90.cmd

@echo off
if defined VS90COMNTOOLS (
call "%VS90COMNTOOLS%\vsvars32.bat")
buildwin 90 build shared both Win32 samples
to
buildwin 90 build static_mt both Win32 samples

add inc
C:\Program Files\poco-1.4.4-alllinux\Util\include
C:\Program Files\poco-1.4.4-alllinux\Net\include
C:\Program Files\poco-1.4.4-alllinux\Foundation\include
C:\Program Files\poco-1.4.4-alllinux\Data\SQLite\include
add lib
C:\Program Files\poco-1.4.4-alllinux\lib

C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\ws2def.h(206) :
error C2011: 'sockaddr' : 'struct' type redefinition
solve
If winsock.h is complaining about redefinitions,
then that suggests that your include chain is including something before it.
winsock2.h needs to be first.

execute link add PocoUtilmtd.lib PocoNetmtd.lib PocoFoundationmtd.lib PocoXMLmtd.lib PocoDataSQLitemtd.lib
option add lib ws2_32.lib iphlpapi.lib

///////////////////build poco-1.4.4-all with ios
!!Notice do not use "root" login

remove previous sdk
/Library/Developer/Shared/uninstall-devtools --mode=all\

xcode 4.x sdk now
copy /Volumes/Xcode/Xcode.app/Contents/Developer to /Developer

modify [Home]/poco-1.4.4-alllinux/build/iPhone
IPHONE_SDK_ROOT = $(shell xcode-select -print-path)/Platforms/$(IPHONE_SDK).platform/Developer/SDKs
to
IPHONE_SDK_ROOT = /Developer/Platforms/$(IPHONE_SDK).platform/Developer/SDKs

//Poco build command line
#Need full path configure, Otherwise you'll get an error saying "Current working directory not under $PROJECT_BASE."

#sim ver
/Users/feelthat/poco-1.4.4-alllinux/configure --prefix=/usr/local/poco-1.4.4_simulator --config=iPhoneSimulator --no-samples --no-tests --omit=NetSSL_OpenSSL,Crypto,Data/ODBC,Data/MySQL,PageCompiler

#device ver
/Users/feelthat/poco-1.4.4-alllinux/configure --prefix=/usr/local/poco-1.4.4_device --config=iPhone --no-samples --no-tests --omit=NetSSL_OpenSSL,Crypto,Data/ODBC,Data/MySQL,PageCompiler

sudo make
sudo make install

chmod -R 777 /usr/local/poco-1.4.4_simulator
chmod -R 777 /usr/local/poco-1.4.4_device

沒有留言:

張貼留言