Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Building ohNet for Android
25-02-2013, 08:33 AM
Post: #11
RE: Building ohNet for Android
I tried github today and build it on Android NDK.

While running to:
...
Compile++ thumb : ohNet <= SsdpDv.cpp
...

It said can't find the Openhome/Net/Stack.cpp. Please help.
Find all posts by this user
25-02-2013, 09:05 AM
Post: #12
RE: Building ohNet for Android
(25-02-2013 08:33 AM)walker Wrote:  I tried github today and build it on Android NDK.

While running to:
...
Compile++ thumb : ohNet <= SsdpDv.cpp
...

It said can't find the Openhome/Net/Stack.cpp. Please help.

That file was recently replaced by OpenHome/Env.cpp. I've committed a fix locally; it should make it onto github this evening. Assuming you're currently blocked, applying the following patch should fix your build

Code:
diff --git a/OpenHome/Net/Bindings/Android/jni/Android.mk b/OpenHome/Net/Binding
index 8a9b195..65c55f1 100644
--- a/OpenHome/Net/Bindings/Android/jni/Android.mk
+++ b/OpenHome/Net/Bindings/Android/jni/Android.mk
@@ -79,7 +79,7 @@ LOCAL_SRC_FILES := $(ohroot)OpenHome/Ascii.cpp \
                    $(ohroot)OpenHome/sha1.c \
                    $(ohroot)OpenHome/Net/Ssdp.cpp \
                    $(ohroot)OpenHome/Net/SsdpDv.cpp \
-                   $(ohroot)OpenHome/Net/Stack.cpp \
+                   $(ohroot)OpenHome/Env.cpp \
                    $(ohroot)OpenHome/Stream.cpp \
                    $(ohroot)OpenHome/Net/Subscription.cpp \
                    $(ohroot)OpenHome/Thread.cpp \
Find all posts by this user
25-02-2013, 09:31 AM
Post: #13
RE: Building ohNet for Android
Thanks for the update. Now I moved on to this, guess it is related.

SharedLibrary : libohNet.so

/Cpp/ControlPoint/CpDeviceDvStd.cpp:13: error: undefined reference to 'OpenHome::Net::gCpStack'

Other undefined reference are:
undefined reference to 'OpenHome::Net::gDvStack'
undefined reference to 'OpenHome::gEnv
Find all posts by this user
25-02-2013, 09:44 AM
Post: #14
RE: Building ohNet for Android
(25-02-2013 09:31 AM)walker Wrote:  Thanks for the update. Now I moved on to this, guess it is related.

SharedLibrary : libohNet.so

/Cpp/ControlPoint/CpDeviceDvStd.cpp:13: error: undefined reference to 'OpenHome::Net::gCpStack'

Other undefined reference are:
undefined reference to 'OpenHome::Net::gDvStack'
undefined reference to 'OpenHome::gEnv

I've committed another fix and included its patch below.

I'll look into setting up an automated build to stop the Android build rotting in future...

Code:
diff --git a/OpenHome/Net/Bindings/Android/jni/Android.mk b/OpenHome/Net/Binding
index 65c55f1..f692f2a 100644
--- a/OpenHome/Net/Bindings/Android/jni/Android.mk
+++ b/OpenHome/Net/Bindings/Android/jni/Android.mk
@@ -59,6 +59,7 @@ LOCAL_SRC_FILES := $(ohroot)OpenHome/Ascii.cpp \
                    $(ohroot)OpenHome/Net/ControlPoint/Upnp/EventUpnp.cpp \
                    $(ohroot)OpenHome/Exception.cpp \
                    $(ohroot)OpenHome/Fifo.cpp \
+                   $(ohroot)OpenHome/Net/Globals.cpp \
                    $(ohroot)OpenHome/Http.cpp \
                    $(ohroot)OpenHome/Net/Device/Bonjour/mDNSCore/DNSCommon.c \
                    $(ohroot)OpenHome/Net/Device/Bonjour/mDNSCore/DNSDigest.c \
Find all posts by this user
25-02-2013, 10:03 AM
Post: #15
RE: Building ohNet for Android
Great fix... At the final stage, it print the following.

/OpenHome/Net/Bindings/Java/InitParams.c: In function 'CallbackMessage':
Bindings/Java/InitParams.c:32:13: error: implicit declaration of function 'printf' [-Werror=implicit-function-declaration]

I added the following in the InitParams.c header. Then all build worked. Will try the lib later.
#include <stdio.h>
Find all posts by this user
25-02-2013, 10:47 AM
Post: #16
RE: Building ohNet for Android
(25-02-2013 10:03 AM)walker Wrote:  Great fix... At the final stage, it print the following.

/OpenHome/Net/Bindings/Java/InitParams.c: In function 'CallbackMessage':
Bindings/Java/InitParams.c:32:13: error: implicit declaration of function 'printf' [-Werror=implicit-function-declaration]

I added the following in the InitParams.c header. Then all build worked. Will try the lib later.
#include <stdio.h>

Thanks, I've applied this fix locally.
Find all posts by this user
03-03-2013, 03:53 PM
Post: #17
RE: Building ohNet for Android
(25-02-2013 10:47 AM)simonc Wrote:  
(25-02-2013 10:03 AM)walker Wrote:  I added the following in the InitParams.c header. Then all build worked. Will try the lib later.
#include <stdio.h>

Thanks, I've applied this fix locally.

Will this be on Github soon?
Find all posts by this user
04-03-2013, 11:59 AM
Post: #18
RE: Building ohNet for Android
(03-03-2013 03:53 PM)simoncn Wrote:  Will this be on Github soon?

I'd committed but not pushed. Thanks for spotting this. The change should be on github this evening.
Find all posts by this user
23-07-2013, 08:44 PM
Post: #19
RE: Building ohNet for Android
It would be great if it were possible to grab some binaries built for Android. Any chance of this?
Find all posts by this user
24-07-2013, 10:06 AM
Post: #20
RE: Building ohNet for Android
(23-07-2013 08:44 PM)ACDN Wrote:  It would be great if it were possible to grab some binaries built for Android. Any chance of this?

Nicely timed request Smile. We're about to look into this so will hopefully have something available in the next couple of weeks.
Find all posts by this user


Forum Jump: