Overview
Features
Download
Documentation
Community
Add-Ons & Services

compiling Poco on Visual Studio for android ?

A general discussion forum.

compiling Poco on Visual Studio for android ?

Postby knu » 08 Feb 2013, 17:22

Hi,

i'm trying to include a native library into a xamarin project.

So, i have my native C++ library flawlessly building in VS2010 with the NDK.

I can include that library into my xamarin project (VS2010,C#) and everything is working as expected.

Now, i want to extend that C++ library to add thread support so i want to add the Poco Library.

I downloaded the poco libraries and imported the foundation project into VS. I set the target to android, added the POCO_ANDROID macro, set the additional source directory to \Poco\ and tried to compile.

At first i had to add the -frtti and -fexceptions command line options, and now i'm stuck with some headers not found:

Code: Select all
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(40,21): error : starlet.h: No such file or directory
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(41,21): error : descrip.h: No such file or directory
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(42,19): error : ssdef.h: No such file or directory
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(43,20): error : syidef.h: No such file or directory
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(44,20): error : iledef.h: No such file or directory
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(45,20): error : lnmdef.h: No such file or directory
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(46,19): error : ioctl.h: No such file or directory
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(51,18): error : inet.h: No such file or directory
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(58,1): warning : "MAXHOSTNAMELEN" redefined
1>  C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(52): includes this header:
1>c:\android-ndk-r8d\platforms\android-9\arch-arm\usr\include\netdb.h(76,1): warning : this is the location of the previous definition
1>  src/Environment_VMS.cpp: In static member function 'static std::string Poco::EnvironmentImpl::osNameImpl()':
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(102): error : 'SYI$_NODE_SWTYPE' was not declared in this scope
1>  src/Environment_VMS.cpp: In static member function 'static std::string Poco::EnvironmentImpl::osVersionImpl()':
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(114): error : 'SYI$_VERSION' was not declared in this scope
1>  src/Environment_VMS.cpp: In static member function 'static std::string Poco::EnvironmentImpl::osArchitectureImpl()':
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(120): error : 'SYI$_ARCH_NAME' was not declared in this scope
1>  src/Environment_VMS.cpp: In static member function 'static std::string Poco::EnvironmentImpl::nodeNameImpl()':
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(126): error : 'SYI$_NODENAME' was not declared in this scope
1>  src/Environment_VMS.cpp: In static member function 'static void Poco::EnvironmentImpl::nodeIdImpl(Poco::UInt8 (&)[6])':
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(132): error : 'memset' is not a member of 'std'
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(144): error : 'memset' is not a member of 'std'
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(147): error : 'memcpy' is not a member of 'std'
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(151): error : 'memcpy' is not a member of 'std'
1>  src/Environment_VMS.cpp: In static member function 'static unsigned int Poco::EnvironmentImpl::processorCountImpl()':
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(163): error : 'ILE3' was not declared in this scope
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(163): error : expected ';' before 'items'
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(164): error : 'items' was not declared in this scope
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(164): error : 'SYI$_ACTIVECPU_CNT' was not declared in this scope
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(171): error : 'sys$getsyiw' was not declared in this scope
1>  src/Environment_VMS.cpp: In static member function 'static std::string Poco::EnvironmentImpl::getsyi(short unsigned int)':
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(188): error : 'ILE3' was not declared in this scope
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(188): error : expected ';' before 'items'
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(189): error : 'items' was not declared in this scope
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(196): error : 'sys$getsyiw' was not declared in this scope
1>  src/Environment_VMS.cpp: In static member function 'static std::string Poco::EnvironmentImpl::trnlnm(const std::string&)':
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(210): error : 'LNM$C_NAMLENGTH' was not declared in this scope
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(213): error : 'ILE3' was not declared in this scope
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(213): error : expected ';' before 'items'
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(214): error : 'items' was not declared in this scope
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(214): error : 'LNM$_STRING' was not declared in this scope
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(215): error : 'result' was not declared in this scope
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(223): error : 'LNM$M_CASE_BLIND' was not declared in this scope
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(224): error : 'tableDsc' was not declared in this scope
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(224): error : 'POCO_DESCRIPTOR_LITERAL' was not declared in this scope
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(225): error : 'nameDsc' was not declared in this scope
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(225): error : 'POCO_DESCRIPTOR_STRING' was not declared in this scope
1>C:\AndroidApps\test\poco-1.4.6\Foundation\src\Environment_VMS.cpp(226): error : 'sys$trnlnm' was not declared in this scope


What am i doing wrong? i can't find a visual studio tutorial on this topic.

Thanks in advance!
knu
 
Posts: 1
Joined: 08 Feb 2013, 17:11

Re: compiling Poco on Visual Studio for android ?

Postby alex » 08 Feb 2013, 18:55

knu wrote:What am i doing wrong? i can't find a visual studio tutorial on this topic.

There are source files in POCO tree that are platform-specific and should only be compiled on their respective platform. The first one (there's more) you are stumbling over is Environment_VMS.cpp - it obviously should not be compiled in your case. We usually include those files in VS projects and exclude them from build.
alex
 
Posts: 1115
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest