readium / readium-lcp-client

This repository is for the Readium Licenced Content Protection (LCP) client side implementation work.
BSD 3-Clause "New" or "Revised" License
17 stars 12 forks source link

build failure, NDK 14 - 16, Windows 10 #42

Closed danielweck closed 6 years ago

danielweck commented 7 years ago
In file included from ../../../../../../../src/third-parties/ziplib/Source/ZipLib/methods/../compression/store/store_encoder.h:6:0,
                   from ../../../../../../../src/third-parties/ziplib/Source/ZipLib/methods/ICompressionMethod.h:4,
                   from ../../../../../../../src/third-parties/ziplib/Source/ZipLib/ZipArchiveEntry.h:5,
                   from ../../../../../../../src/third-parties/ziplib/Source/ZipLib/ZipArchive.h:4,
                   from ../../../../../../../src/third-parties/ziplib/Source/ZipLib/ZipFile.h:2,
                   from C:\Users\Daniel\GitHub\SDKLauncher-Android\readium-lcp-client\src\lcp-client-lib\LcpService.cpp:52:
  ../../../../../../../src/third-parties/ziplib/Source/ZipLib/methods/../compression/store/../../streams/crc32stream.h:3:41: fatal error: streambuffs/crc32_streambuf.h: No such file or directory
   #include "streambuffs/crc32_streambuf.h"
                                           ^
danielweck commented 7 years ago

r15c (latest, still with GCC compat)

danielweck commented 7 years ago

Note that this occurs when invoking gradlew build from the command line. My local.properties:

sdk.dir=C\:\\Users\\Daniel\\AppData\\Local\\Android\\android-sdk
ndk.dir=C\:\\Users\\Daniel\\AppData\\Local\\Android\\android-sdk\\ndk-bundle

readium.ndk_experimental=true
readium.ndk_clang=false
readium.ndk_skipX86=true
readium.ndk_skipARM=false
readium.sdk_lib_dir=../../../readium-sdk/Platform/Android/epub3/build/outputs/native/debug/arm/lib/armeabi-v7a/
readium.sdk_include_dir=../../../readium-sdk/Platform/Android/epub3/include/
danielweck commented 7 years ago

This same compiler error also occurs when compiling from Android Studio Error:fatal error: streambuffs/crc32_streambuf.h: No such file or directory (disabled readium.sdk_lib_dir and readium.sdk_include_dir vars in local.properties, and manual copy of readium-sdk/Platform/Android/epub3/build/outputs/native/debug/arm/lib/armeabi-v7a/*.so into readium-sdk/Platform/Android/epub3/libs/armeabi-v7a/*.so so that the Gradle build script can find the prebuilt ReadiumSDK shared libraries)

danielweck commented 7 years ago

I'm on Windows 10 by the way.

NDK r15c is installed by Android Studio in PATH/TO/android-sdk/ndk-bundle/. https://developer.android.com/ndk/downloads/index.html

I am going to "downgrade" to r14b and see what happens... https://developer.android.com/ndk/downloads/older_releases.html

What a waste of time :(

danielweck commented 7 years ago

CC @clebeaupin @llemeurfr

danielweck commented 7 years ago

May be related to: https://github.com/readium/SDKLauncher-Android/issues/125 ?

danielweck commented 7 years ago

Same error with NDK 14 !

Side note: Strangely, the ReadiumSDK libs are now in readium-sdk\Platform\Android\lib\build\intermediates\binaries\debug\arm\lib\armeabi-v7a instead of readium-sdk/Platform/Android/epub3/build/outputs/native/debug/arm/lib/armeabi-v7a/ (not sure why)

danielweck commented 7 years ago

Ok, so next step: try to build on OSX (last time I tried it worked).

danielweck commented 7 years ago

I checked on OSX, works just fine. I made sure to use the exact same SDK platform versions (all the way down to CMake, LLDB etc.) So, this seems to be a Windows-specific problem ... which is a bummer, as my Windows 10 laptop is quicker than my Mac, so I would prefer to use it for Android development :(

danielweck commented 6 years ago

Okay, after quite a bit of debugging, trial and experimentations...the code compiles in Windows when the templated C++ classes are moved: https://github.com/readium/readium-lcp-client/tree/develop/src/third-parties/ziplib/Source/ZipLib/streams/streambuffs Bizarre compiler error! (obscure console messages too)

Testing now...

danielweck commented 6 years ago

Fixed via: https://github.com/readium/readium-lcp-client/commit/6ae365f9a3d7eca748eed0ba954b2257e377f0f9