wvelandia / spatialite-android

Automatically exported from code.google.com/p/spatialite-android
0 stars 0 forks source link

Problem in JNI when performing NDK-BUILD #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Downloaded source
2. Downloaded GEOS and PROJ, extracted into the JNI folder and performed 
configuration (that went ok for both)
3. back in the JNI folder and performed ndk-build.

What is the expected output? What do you see instead?
Expected ndk-build to complete.

What version of the product are you using? On what operating system?
CYGWIN on Windows 7, ndk r6b, jdk 1.7.0_01

Please provide any additional information below.
HFisher@Toshiba500 /cygdrive/c/android-ndk-r6b/projects/spatialite-android/jni/p
roj-4.6.1
$ touch empty.cpp

HFisher@Toshiba500 /cygdrive/c/android-ndk-r6b/projects/spatialite-android/jni/p
roj-4.6.1
$ cd c:/android-ndk-r6b/projects/spatialite-android/jni

HFisher@Toshiba500 /cygdrive/c/android-ndk-r6b/projects/spatialite-android/jni
$ ndk-build
Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver
Gdbsetup  : libs/armeabi/gdb.setup
make: *** No rule to make target 
`/cygdrive/c/android-ndk-r6b/projects/spatialite-android/jni/javasqlite-20110106
/native/sqlite_jni.c', needed by 
`/cygdrive/c/android-ndk-r6b/projects/spatialite-android/obj/local/armeabi/objs-
debug/jsqlite/javasqlite-20110106/native/sqlite_jni.o'.  Stop.

Original issue reported on code.google.com by asse...@gmail.com on 12 Nov 2011 at 8:26

GoogleCodeExporter commented 9 years ago
I was mistaken I had a folder labelled incorrectly, however now I am getting 
the following with the build.

Compile thumb  : proj <= rtodms.c
Compile thumb  : proj <= vector.c
StaticLibrary  : libproj.a
Compile++ thumb  : geos <= geos_c.cpp
In file included from 
C:/android-ndk-r6b/projects/spatialite-android/jni/geos-3.2.2/source/headers/geo
s/geom/Coordinate.h:20,
                 from C:/android-ndk-r6b/projects/spatialite-andriod/jni/geos-3.2.2/source/headers/geos/geom/Envelope.h:26,
                 from C:/android-ndk-r6b/projects/spatialite-android/jni/geos-3.2.2/source/headers/geos/index/strtree/STRtree.h:27,
                 from C:/android-ndk-r6b/projects/spatialite-android/jni/geos-3.2.2/capi/geos_c.cpp:19:
C:/android-ndk-r6b/projects/spatialite-android/jni/geos-3.2.2/source/headers/geo
s/platform.h:20: error: ieeefp.h: No such file or directory
C:/android-ndk-r6b/projects/spatialite-android/jni/geos-3.2.2/source/headers/geo
s/platform.h:94:5: warning: #warning "Could not find 64bit integer definition!"
make: *** 
[/cygdrive/c/android-ndk-r6b/projects/spatialite-android/obj/local/armeabi/objs-
debug/geos/geos-3.2.2/capi/geos_c.o] Error 1

Any help would be most appreciated, Hayden

Original comment by asse...@gmail.com on 13 Nov 2011 at 1:53

GoogleCodeExporter commented 9 years ago
This is probably a issue with the ./configure step.  I did my build on Ubuntu 
10.04, with android-ndk-r5b.  If you find a fix let me know.

Original comment by efroh...@gmail.com on 29 Jan 2012 at 3:53

GoogleCodeExporter commented 9 years ago
I've encountered the same problem as Hayden:

......../geos-3.2.2/source/headers/geos/platform.h:20: error: ieeefp.h: No such 
file or directory

and appears ndk-build failed. Any help would be most appreciated.
Windows 7 64bit, android-ndk-r7b, cygwin

Original comment by diligent...@gmail.com on 26 Feb 2012 at 3:14

GoogleCodeExporter commented 9 years ago
BTW,  ieeefp.h file could be found in \cygwin\usr\include directory.

Original comment by diligent...@gmail.com on 26 Feb 2012 at 3:16

GoogleCodeExporter commented 9 years ago
Have you tried to uncomment line 15 in platform.h?

/* #undef HAVE_IEEEFP_H */

I can post new binaries if that would help move things along.

Original comment by efroh...@gmail.com on 27 Feb 2012 at 12:36

GoogleCodeExporter commented 9 years ago
Can someone post the platform.h?

Original comment by efroh...@gmail.com on 27 Feb 2012 at 1:51

GoogleCodeExporter commented 9 years ago
Hi efroh...@gmail.com, here is platform.h, FYI.

Original comment by diligent...@gmail.com on 27 Feb 2012 at 2:11

Attachments:

GoogleCodeExporter commented 9 years ago
and Hi again, efroh...@gmail.com,
Thanks very much for your help:
"Have you tried to uncomment line 15 in platform.h?

/* #undef HAVE_IEEEFP_H */"

I didn't find this #undef, however, I manually add: #undef HAVE_IEEEFP_H under 
line 15:#define HAVE_IEEEFP_H 1.
ndk-build again, this time previous error has fixed, but new error comes:

Compile++ thumb  : geos <= InteriorPointPoint.cpp
Compile++ thumb  : geos <= LineIntersector.cpp
D:/spatialite-android/jni/geos-3.2.2/source/algorithm/LineIntersector.cpp: In 
st                                                                              
                                  atic member function 'static double 
geos::algorithm::LineIntersector::interpolat                                    

eZ(const geos::geom::Coordinate&, const geos::geom::Coordinate&, const 
geos::geo                                                                       
                                         m::Coordinate&)':
D:/spatialite-android/jni/geos-3.2.2/source/algorithm/LineIntersector.cpp:224: 
e                                                                               
                                 rror: expected unqualified-id before '(' token
D:/spatialite-android/jni/geos-3.2.2/source/algorithm/LineIntersector.cpp:232: 
e                                                                               
                                 rror: expected unqualified-id before '(' token
D:/spatialite-android/jni/geos-3.2.2/source/algorithm/LineIntersector.cpp: In 
me                                                                              
                                  mber function 'void 
geos::algorithm::LineIntersector::computeIntersection(const                     

            geos::geom::Coordinate&, const geos::geom::Coordinate&, const 
geos::geom::Coordi                                                              
                                                  nate&)':
D:/spatialite-android/jni/geos-3.2.2/source/algorithm/LineIntersector.cpp:304: 
e                                                                               
                                 rror: expected unqualified-id before '(' token
D:/spatialite-android/jni/geos-3.2.2/source/algorithm/LineIntersector.cpp:306: 
e                                                                               
                                 rror: expected unqualified-id before '(' token
...

I opened LineIntersector.cpp and found these error has related to a function 
called "ISNAN", and google "expected unqualified-id before '(' token" found 
that this type of error always related to duplicate function declaration in 
multi header files. I'm totally newbie to C/C++ and also linux, but searched 
keyword "ISNAN", and found that in platform.h file, there is something to do 
with "ISNAN". So I try to add one line:
#define HAVE_ISNAN 1
under the line(near line 24):
/* #undef HAVE_ISNAN */

ndk-build again, succeed!
...
StaticLibrary  : libgeos.a
StaticLibrary  : libspatialite.a
SharedLibrary  : libjsqlite.so
Install        : libjsqlite.so => libs/armeabi/libjsqlite.so

Thanks again for your help and your project!

Original comment by diligent...@gmail.com on 27 Feb 2012 at 2:25

GoogleCodeExporter commented 9 years ago
Thank you for the feedback...I am going to close this issue, but I think the 
solution is going to be checking in geos to the repository.  I will update the 
home page with a note for OSX and Cygwin.

Original comment by efroh...@gmail.com on 27 Feb 2012 at 1:19

GoogleCodeExporter commented 9 years ago
Not at all, thanks for your project:)

Original comment by diligent...@gmail.com on 27 Feb 2012 at 1:23