Problems when building for Android | dcmtk-3.6.1_20150217

Compilation and installation of DCMTK

Moderator: Moderator Team

Message
Author
Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Problems when building for Android | dcmtk-3.6.1_2015021

#16 Post by Jan Schlamelcher »

Okay, the interesting part would be:

Code: Select all

Determining if the include file sstream exists failed with the following output:
 
 
I noticed this also happened for many other configure tests :shock:. Idk why there is no output at all, I would at least expect some kind of error message. Perhaps the compiler simply segfaults? I fear there isn't really something I could say except for: start over with an empty build directory and perhaps another version of the Android NDK (maybe the newest would work, as we identified the problem to be the ANDROID_NATIVE_API_LEVEL 21 and perhaps not the NDK version). Btw I'm currently using this one.

julialecat
Posts: 16
Joined: Wed, 2012-04-11, 17:02

Re: Problems when building for Android | dcmtk-3.6.1_2015021

#17 Post by julialecat »

I started over with both android-ndk-r10d and android-ndk-r10e with exactly the same result. Btw, I suppose the fact that the cmake variable ANDROID_STL_SHARED_OBJECT is set to ANDROID_STL_SHARED_OBJECT-NOTFOUND is a consequence of the errors without output you mentioned above, right? Do we really get to a dead-end street? :cry:

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Problems when building for Android | dcmtk-3.6.1_2015021

#18 Post by Jan Schlamelcher »

julialecat wrote:Btw, I suppose the fact that the cmake variable ANDROID_STL_SHARED_OBJECT is set to ANDROID_STL_SHARED_OBJECT-NOTFOUND
Nope, this is absolutely fine if you use the static version of the library (which is the default). The variable is only relevant if the script needs to copy the shared version of the library to the emulator for running the executables on the device and otherwise the script does not even try to detect a value.

I had another look at your CMake Logs. It seems that all CHECK_INCLUDE_FILE_CXX tests are failing, which is very strange since this is a pure CMake function we did not (and cannot) modify (perhaps the android.toolchain.cmake affects the results though). Which version of CMake are you using?

julialecat
Posts: 16
Joined: Wed, 2012-04-11, 17:02

Re: Problems when building for Android | dcmtk-3.6.1_2015021

#19 Post by julialecat »

Understood.

Tried both with CMake 2.8.12.2 and CMake 3.2.3.

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Problems when building for Android | dcmtk-3.6.1_2015021

#20 Post by Jan Schlamelcher »

Just had an Idea: are you still using my patch or the original snapshot version?

julialecat
Posts: 16
Joined: Wed, 2012-04-11, 17:02

Re: Problems when building for Android | dcmtk-3.6.1_2015021

#21 Post by julialecat »

Ok, I still had your patch so I rolled back with the original android.toolchain.cmake:

Code: Select all

set( ANDROID_TOOLCHAIN_CONFIG_FILE "${CMAKE_BINARY_DIR}/../android.toolchain.config.cmake" )
Then I got the same error but I guess something was different because I had much less errors in the console than before.

Here are my CMakeOutput.log: http://pastebin.com/QyQUVdsi (1) and http://pastebin.com/EFYmSpeA (2) and CMakeError.log: http://pastebin.com/u5gKcNFc

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Problems when building for Android | dcmtk-3.6.1_2015021

#22 Post by Jan Schlamelcher »

Which one of the errors is "the same error" :-) ?

julialecat
Posts: 16
Joined: Wed, 2012-04-11, 17:02

Re: Problems when building for Android | dcmtk-3.6.1_2015021

#23 Post by julialecat »

The famous error is:

Code: Select all

CMake Error at CMake/GenerateDCMTKConfigure.cmake:773 (MESSAGE):
  error: only position independent executables (PIE) are supported.

Call Stack (most recent call first):
  CMakeLists.txt:48 (INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES)
Here my complete console output (many header files not found :? ):

Code: Select all

Starting the Android device emulator...
Warning: TIFF support will be disabled because libtiff was not found.
Warning: PNG support will be disabled because libpng was not found.
Warning: OPENSSL support will be disabled because openssl was not found.
Warning: XML support will be disabled because libxml2 was not found.
Info: DCMTK ZLIB support will be enabled
Could NOT find SNDFILE (missing:  SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR) 
Warning: SNDFILE support will be disabled because libsndfile was not found.
Could NOT find LIBICONV (missing:  LIBICONV_LIBRARY LIBICONV_INCLUDE_DIR) 
Could NOT find LIBCHARSET (missing:  LIBCHARSET_LIBRARY LIBCHARSET_INCLUDE_DIR) 
Warning: ICONV support will be disabled because libiconv was not found. Correct LIBICONV_LIBDIR and LIBICONV_INCLUDE_DIR and re-enable DCMTK_WITH_ICONV.
Could NOT find WRAP (missing:  WRAP_LIBRARY WRAP_INCLUDE_DIR) 
Warning: WRAP support will be disabled because libwrap was not found.
Warning: DOXYGEN support will be disabled because doxygen was not found.
Info: DCMTK's builtin private dictionary support will be disabled
Info: Thread support will be enabled
Info: Wide char file I/O functions will be disabled
Info: Wide char main function for command line tools will be disabled
Looking for sys/types.h
Looking for sys/types.h - found
Looking for stdint.h
Looking for stdint.h - found
Looking for stddef.h
Looking for stddef.h - found
Check size of char
Check size of char - done
Check size of double
Check size of double - done
Check size of float
Check size of float - done
Check size of int
Check size of int - done
Check size of long
Check size of long - done
Check size of short
Check size of short - done
Check size of void*
Check size of void* - done
Looking for __FUNCTION__
Looking for __FUNCTION__ - found
Looking for __PRETTY_FUNCTION__
Looking for __PRETTY_FUNCTION__ - found
Looking for __func__
Looking for __func__ - found
Looking for C++ include errno.h
Looking for C++ include errno.h - found
Looking for C++ include dirent.h
Looking for C++ include dirent.h - found
Looking for C++ include fcntl.h
Looking for C++ include fcntl.h - found
Looking for C++ include fstream
Looking for C++ include fstream - found
Looking for C++ include fstream.h
Looking for C++ include fstream.h - not found
Looking for C++ include fnmatch.h
Looking for C++ include fnmatch.h - found
Looking for C++ include float.h
Looking for C++ include float.h - found
Looking for C++ include grp.h
Looking for C++ include grp.h - found
Looking for C++ include malloc.h
Looking for C++ include malloc.h - found
Looking for C++ include math.h
Looking for C++ include math.h - found
Looking for C++ include ieeefp.h
Looking for C++ include ieeefp.h - not found
Looking for C++ include inttypes.h
Looking for C++ include inttypes.h - found
Looking for C++ include iomanip
Looking for C++ include iomanip - found
Looking for C++ include iomanip.h
Looking for C++ include iomanip.h - not found
Looking for C++ include iostream
Looking for C++ include iostream - found
Looking for C++ include iostream.h
Looking for C++ include iostream.h - not found
Looking for C++ include io.h
Looking for C++ include io.h - not found
Looking for C++ include iso646.h
Looking for C++ include iso646.h - found
Looking for C++ include png.h
Looking for C++ include png.h - not found
Looking for C++ include limits.h
Looking for C++ include limits.h - found
Looking for C++ include climits
Looking for C++ include climits - found
Looking for C++ include locale.h
Looking for C++ include locale.h - found
Looking for C++ include ndir.h
Looking for C++ include ndir.h - not found
Looking for C++ include netdb.h
Looking for C++ include netdb.h - found
Looking for C++ include new.h
Looking for C++ include new.h - not found
Looking for C++ include pwd.h
Looking for C++ include pwd.h - found
Looking for C++ include semaphore.h
Looking for C++ include semaphore.h - found
Looking for C++ include setjmp.h
Looking for C++ include setjmp.h - found
Looking for C++ include sstream
Looking for C++ include sstream - found
Looking for C++ include sstream.h
Looking for C++ include sstream.h - not found
Looking for C++ include stat.h
Looking for C++ include stat.h - not found
Looking for C++ include stdbool.h
Looking for C++ include stdbool.h - found
Looking for C++ include cstddef
Looking for C++ include cstddef - found
Looking for C++ include cstdint
Looking for C++ include cstdint - not found
Looking for C++ include stdio.h
Looking for C++ include stdio.h - found
Looking for C++ include cstdio
Looking for C++ include cstdio - found
Looking for C++ include strings.h
Looking for C++ include strings.h - found
Looking for C++ include string.h
Looking for C++ include string.h - found
Looking for C++ include strstream.h
Looking for C++ include strstream.h - not found
Looking for C++ include strstream
Looking for C++ include strstream - not found
Looking for C++ include strstrea.h
Looking for C++ include strstrea.h - not found
Looking for C++ include synch.h
Looking for C++ include synch.h - not found
Looking for C++ include syslog.h
Looking for C++ include syslog.h - found
Looking for C++ include sys/errno.h
Looking for C++ include sys/errno.h - found
Looking for C++ include sys/dir.h
Looking for C++ include sys/dir.h - not found
Looking for C++ include sys/file.h
Looking for C++ include sys/file.h - found
Looking for C++ include sys/ndir.h
Looking for C++ include sys/ndir.h - not found
Looking for C++ include sys/param.h
Looking for C++ include sys/param.h - found
Looking for C++ include sys/resource.h
Looking for C++ include sys/resource.h - found
Looking for C++ include sys/select.h
Looking for C++ include sys/select.h - found
Looking for C++ include sys/syscall.h
Looking for C++ include sys/syscall.h - found
Looking for C++ include sys/systeminfo.h
Looking for C++ include sys/systeminfo.h - not found
Looking for C++ include sys/time.h
Looking for C++ include sys/time.h - found
Looking for C++ include sys/timeb.h
Looking for C++ include sys/timeb.h - found
Looking for C++ include sys/utime.h
Looking for C++ include sys/utime.h - found
Looking for C++ include sys/utsname.h
Looking for C++ include sys/utsname.h - found
Looking for C++ include sys/wait.h
Looking for C++ include sys/wait.h - found
Looking for C++ include sys/socket.h
Looking for C++ include sys/socket.h - found
Looking for C++ include thread.h
Looking for C++ include thread.h - not found
Looking for C++ include sys/stat.h
Looking for C++ include sys/stat.h - found
Looking for C++ include time.h
Looking for C++ include time.h - found
Looking for C++ include unistd.h
Looking for C++ include unistd.h - found
Looking for C++ include unix.h
Looking for C++ include unix.h - not found
Looking for C++ include utime.h
Looking for C++ include utime.h - found
Looking for C++ include wchar.h
Looking for C++ include wchar.h - found
Looking for C++ include wctype.h
Looking for C++ include wctype.h - found
Looking for C++ include alloca.h
Looking for C++ include alloca.h - found
Looking for C++ include arpa/inet.h
Looking for C++ include arpa/inet.h - found
Looking for C++ include ctype.h
Looking for C++ include ctype.h - found
Looking for C++ include memory.h
Looking for C++ include memory.h - found
Looking for C++ include pthread.h
Looking for C++ include pthread.h - found
Looking for C++ include libc.h
Looking for C++ include libc.h - not found
Looking for C++ include stdlib.h
Looking for C++ include stdlib.h - found
Looking for C++ include stdarg.h
Looking for C++ include stdarg.h - found
Looking for C++ include cstdarg
Looking for C++ include cstdarg - found
Looking for C++ include signal.h
Looking for C++ include signal.h - found
Looking for C++ include fenv.h
Looking for C++ include fenv.h - found
Looking for include files sys/types.h, netinet/in_systm.h
Looking for include files sys/types.h, netinet/in_systm.h - found
Looking for 3 include files sys/types.h, ..., netinet/in.h
Looking for 3 include files sys/types.h, ..., netinet/in.h - found
Looking for 4 include files sys/types.h, ..., netinet/tcp.h
Looking for 4 include files sys/types.h, ..., netinet/tcp.h - found
Looking for connect
Looking for connect - found
Looking for accept
Looking for accept - found
Looking for access
Looking for access - found
Looking for bcmp
Looking for bcmp - not found
Looking for bcopy
Looking for bcopy - found
Looking for bind
Looking for bind - found
Looking for bzero
Looking for bzero - found
Looking for cuserid
Looking for cuserid - not found
Looking for _doprnt
Looking for _doprnt - not found
Looking for finite
Looking for finite - not found
Looking for flock
Looking for flock - found
Looking for fork
Looking for fork - found
Looking for fseeko
Looking for fseeko - found
Looking for ftime
Looking for ftime - found
Looking for getaddrinfo
Looking for getaddrinfo - found
Looking for getenv
Looking for getenv - found
Looking for geteuid
Looking for geteuid - found
Looking for getgrnam
Looking for getgrnam - found
Looking for gethostbyname
Looking for gethostbyname - found
Looking for gethostbyname_r
Looking for gethostbyname_r - found
Looking for gethostbyaddr_r
Looking for gethostbyaddr_r - not found
Looking for getgrnam_r
Looking for getgrnam_r - not found
Looking for getpwnam_r
Looking for getpwnam_r - not found
Looking for gethostname
Looking for gethostname - found
Looking for gethostid
Looking for gethostid - not found
Looking for getlogin
Looking for getlogin - found
Looking for getpid
Looking for getpid - found
Looking for getpwnam
Looking for getpwnam - found
Looking for getsockname
Looking for getsockname - found
Looking for getsockopt
Looking for getsockopt - found
Looking for getuid
Looking for getuid - found
Looking for gmtime_r
Looking for gmtime_r - found
Looking for index
Looking for index - found
Looking for isinf
Looking for isinf - not found
Looking for isnan
Looking for isnan - not found
Looking for itoa
Looking for itoa - not found
Looking for listen
Looking for listen - found
Looking for localtime_r
Looking for localtime_r - found
Looking for lockf
Looking for lockf - not found
Looking for lstat
Looking for lstat - found
Looking for malloc_debug
Looking for malloc_debug - not found
Looking for mbstowcs
Looking for mbstowcs - found
Looking for wcstombs
Looking for wcstombs - found
Looking for memcmp
Looking for memcmp - found
Looking for memcpy
Looking for memcpy - found
Looking for memmove
Looking for memmove - found
Looking for memset
Looking for memset - found
Looking for mkstemp
Looking for mkstemp - found
Looking for mktemp
Looking for mktemp - found
Looking for rindex
Looking for rindex - not found
Looking for select
Looking for select - found
Looking for setsockopt
Looking for setsockopt - found
Looking for setuid
Looking for setuid - found
Looking for sleep
Looking for sleep - found
Looking for socket
Looking for socket - found
Looking for stat
Looking for stat - found
Looking for strchr
Looking for strchr - found
Looking for strdup
Looking for strdup - found
Looking for strerror
Looking for strerror - found
Looking for strlcat
Looking for strlcat - found
Looking for strlcpy
Looking for strlcpy - found
Looking for strstr
Looking for strstr - found
Looking for strtoul
Looking for strtoul - found
Looking for sysinfo
Looking for sysinfo - found
Looking for tempnam
Looking for tempnam - found
Looking for tmpnam
Looking for tmpnam - found
Looking for uname
Looking for uname - found
Looking for usleep
Looking for usleep - found
Looking for _vsnprintf_s
Looking for _vsnprintf_s - not found
Looking for vfprintf_s
Looking for vfprintf_s - not found
Looking for vprintf
Looking for vprintf - found
Looking for vsnprintf
Looking for vsnprintf - found
Looking for vsprintf_s
Looking for vsprintf_s - not found
Looking for wait3
Looking for wait3 - found
Looking for waitpid
Looking for waitpid - found
Looking for _findfirst
Looking for _findfirst - not found
Looking for nanosleep
Looking for nanosleep - found
Looking for prototype of isinf
Looking for prototype of isinf - not found.
Looking for prototype of isnan
Looking for prototype of isnan - found
Looking for prototype of finite
Looking for prototype of finite - found
Looking for prototype of flock
Looking for prototype of flock - found
Looking for prototype of gethostbyname
Looking for prototype of gethostbyname - found
Looking for prototype of gethostbyname_r
Looking for prototype of gethostbyname_r - found
Looking for prototype of gethostid
Looking for prototype of gethostid - not found.
Looking for prototype of bzero
Looking for prototype of bzero - found
Looking for prototype of gethostname
Looking for prototype of gethostname - found
Looking for prototype of waitpid
Looking for prototype of waitpid - found
Looking for prototype of wait3
Looking for prototype of wait3 - found
Looking for prototype of usleep
Looking for prototype of usleep - found
Looking for prototype of accept
Looking for prototype of accept - found
Looking for prototype of bind
Looking for prototype of bind - found
Looking for prototype of getsockname
Looking for prototype of getsockname - found
Looking for prototype of getsockopt
Looking for prototype of getsockopt - found
Looking for prototype of setsockopt
Looking for prototype of setsockopt - found
Looking for prototype of socket
Looking for prototype of socket - found
Looking for prototype of listen
Looking for prototype of listen - found
Looking for prototype of std::vfprintf
Looking for prototype of std::vfprintf - found
Looking for prototype of std::vsnprintf
Looking for prototype of std::vsnprintf - not found.
Looking for prototype of _stricmp
Looking for prototype of _stricmp - not found.
Looking for prototype of socklen_t definition
Looking for prototype of socklen_t definition - found
Looking for prototype of gettimeofday
Looking for prototype of gettimeofday - found
Looking for prototype of connect
Looking for prototype of connect - found
Looking for prototype of mkstemp
Looking for prototype of mkstemp - found
Looking for prototype of mktemp
Looking for prototype of mktemp - found
Looking for prototype of select
Looking for prototype of select - found
Looking for prototype of strcasecmp
Looking for prototype of strcasecmp - found
Looking for prototype of strncasecmp
Looking for prototype of strncasecmp - found
Looking for prototype of strerror_r
Looking for prototype of strerror_r - found
Looking for prototype of SYS_gettid
Looking for prototype of SYS_gettid - not found.
Looking for prototype of std::ios_base::openmode definition
Looking for prototype of std::ios_base::openmode definition - not found.
Looking for prototype of pthread_rwlock_init
Looking for prototype of pthread_rwlock_init - found
Looking for prototype of __sync_add_and_fetch((int*)0,0)
Looking for prototype of __sync_add_and_fetch((int*)0,0) - found
Looking for prototype of __sync_sub_and_fetch((int*)0,0)
Looking for prototype of __sync_sub_and_fetch((int*)0,0) - found
Looking for prototype of InterlockedIncrement((long*)0)
Looking for prototype of InterlockedIncrement((long*)0) - not found.
Looking for prototype of InterlockedDecrement((long*)0)
Looking for prototype of InterlockedDecrement((long*)0) - not found.
Looking for prototype of _fpclassf(0.0f)
Looking for prototype of _fpclassf(0.0f) - not found.
Looking for prototype of nanosleep
Looking for prototype of nanosleep - found
Looking for prototype of &passwd::pw_gecos
Looking for prototype of &passwd::pw_gecos - not found.
Looking for prototype of uchar definition
Looking for prototype of uchar definition - not found.
Looking for prototype of ushort definition
Looking for prototype of ushort definition - not found.
Looking for prototype of uint definition
Looking for prototype of uint definition - found
Looking for prototype of ulong definition
Looking for prototype of ulong definition - not found.
Looking for prototype of longlong definition
Looking for prototype of longlong definition - not found.
Looking for prototype of ulonglong definition
Looking for prototype of ulonglong definition - not found.
Looking for prototype of long long definition
Looking for prototype of long long definition - found
Looking for prototype of unsigned long long definition
Looking for prototype of unsigned long long definition - found
Looking for prototype of fpos64_t definition
Looking for prototype of fpos64_t definition - not found.
Looking for prototype of off64_t definition
Looking for prototype of off64_t definition - found
Looking for prototype of popen
Looking for prototype of popen - found
Looking for prototype of pclose
Looking for prototype of pclose - found
Checking signedness of char
Waiting until the Android device emulator is ready to receive instructions...
error: only position independent executables (PIE) are supported.

Checking signedness of char -- signed
Checking whether C++ type bool exists
Checking whether C++ type bool exists -- yes
Checking whether pthread_t is an integer type
Checking whether pthread_t is an integer type -- yes
Checking whether typename works correctly
Checking whether typename works correctly -- yes
Checking whether ENAMETOOLONG is defined
Checking whether ENAMETOOLONG is defined -- yes
Checking whether strerror_r returns an int
Checking whether strerror_r returns an int -- yes
Checking whether variable length arrays are supported
Checking whether variable length arrays are supported -- yes
Checking whether std::ios::nocreate exists
Checking whether std::ios::nocreate exists -- no
Checking whether explicit large file support is available
Checking whether explicit large file support is available -- no
Checking whether socket functions accept an int* argument
Checking whether socket functions accept an int* argument -- yes
Checking whether select() accepts an int* argument
Checking whether select() accepts an int* argument -- no
Checking whether __alignof__ is supported
Checking whether __alignof__ is supported -- yes
Checking whether __alignof is supported
Checking whether __alignof is supported -- yes
Checking whether __attribute__((aligned)) is supported
Checking whether __attribute__((aligned)) is supported -- yes
Checking whether __declspec(align) is supported
Checking whether __declspec(align) is supported -- no
Looking for pthread_key_create in pthread
Looking for pthread_key_create in pthread - not found
Looking for sem_init in rt
Looking for sem_init in rt - not found
CMake Error at CMake/GenerateDCMTKConfigure.cmake:773 (MESSAGE):
  error: only position independent executables (PIE) are supported.

Call Stack (most recent call first):
  CMakeLists.txt:48 (INSPECT_FUNDAMENTAL_ARITHMETIC_TYPES)


Configuring incomplete, errors occurred!
See also "/home/julia/DCMTK-Android/CMakeFiles/CMakeOutput.log".
See also "/home/julia/DCMTK-Android/CMakeFiles/CMakeError.log".

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Problems when building for Android | dcmtk-3.6.1_2015021

#24 Post by Jan Schlamelcher »

Okay, the headers seem normal to me now, so we can say the patch was a bad idea, seems I already thought about what I was doing when I coded those paths in the android.toolchain.cmake.
We should probably expect the problem to be related to the emulator/SDK then, so which SDK version are you using and what is the emulator configuration like?

julialecat
Posts: 16
Joined: Wed, 2012-04-11, 17:02

Re: Problems when building for Android | dcmtk-3.6.1_2015021

#25 Post by julialecat »

Using Android Virtual Device Manager from Android Studio:
  • 2.7" QVGA, 240x320, ldpi
  • API 21, armeabi-v7a, Android 5.0.1
Tried also with API 22, armeabi-v7a, Android 5.1.1

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Problems when building for Android | dcmtk-3.6.1_2015021

#26 Post by Jan Schlamelcher »

I just found this. It seems to me (having QUICKLY read the linked thread) that newer Android devices require special settings when used in conjuction with newer API_LEVELS and that the android.toolchain.cmake does not consider this because it is simply older than these new Android versions. One of the workarounds in the linked thread will possibly help with your problem at hand, I'll try to update the android.toolchain.file to work with newer SDK/NDK versions when I find the time for it.
Effectively a patch would probably look somwhat like this (UNTESTED, as I cannot reproduce your problem with my current Android tools/setup):

Code: Select all

diff --git a/CMake/android.toolchain.cmake b/CMake/android.toolchain.cmake
index 94f7da4..9101b5e 100644
--- a/CMake/android.toolchain.cmake
+++ b/CMake/android.toolchain.cmake
@@ -1291,7 +1291,7 @@ endif()
 
 # NDK flags
 if( ARMEABI OR ARMEABI_V7A )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fpic -funwind-tables" )
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fpic -fPIE -funwind-tables" )
  if( NOT ANDROID_FORCE_ARM_BUILD AND NOT ARMEABI_V6 )
   set( ANDROID_CXX_FLAGS_RELEASE "-mthumb -fomit-frame-pointer -fno-strict-aliasing" )
   set( ANDROID_CXX_FLAGS_DEBUG   "-marm -fno-omit-frame-pointer -fno-strict-aliasing" )
@@ -1416,7 +1416,7 @@ set( ANDROID_RELRO                  ${ANDROID_RELRO}                  CACHE BOOL
 mark_as_advanced( ANDROID_NO_UNDEFINED ANDROID_SO_UNDEFINED ANDROID_FUNCTION_LEVEL_LINKING ANDROID_GOLD_LINKER ANDROID_NOEXECSTACK ANDROID_RELRO )
 
 # linker flags
-set( ANDROID_LINKER_FLAGS "" )
+set( ANDROID_LINKER_FLAGS "-fPIE -pie" )
 
 if( ARMEABI_V7A )
  # this is *required* to use the following linker flags that routes around

julialecat
Posts: 16
Joined: Wed, 2012-04-11, 17:02

Re: Problems when building for Android | dcmtk-3.6.1_2015021

#27 Post by julialecat »

Finally, finished Configure without errors and then Generate :D

Last configuration was:
  • Android NDK: r10d
  • Emulator: API 22
  • ANDROID_NATIVE_API_LEVEL: 17
Thank you so much for your time and efforts!

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Problems when building for Android | dcmtk-3.6.1_2015021

#28 Post by Jan Schlamelcher »

Nice, great it finally worked :-). Did you use the patch from my latest post or just change the API settings etc.?

julialecat
Posts: 16
Joined: Wed, 2012-04-11, 17:02

Re: Problems when building for Android | dcmtk-3.6.1_2015021

#29 Post by julialecat »

I used your patch sure. I only let my last configuration just in case.
Now you can update the wiki :wink:

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: Problems when building for Android | dcmtk-3.6.1_2015021

#30 Post by Jan Schlamelcher »

Nice, I'll have to test if the patch might also have negative effects on older Android versions before I can incoorporate it though.
julialecat wrote:Now you can update the wiki :wink:
Yeah, hopefully :D.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest