0

I have an ndk library that is build in c to be included in a project. Tried building the ndk with Windows environment variable Path=C:\android\android-ndk-r8c-windows\android-ndk-r8c\ The command is run from cygwin bash prompt.

Tried with ndk-build from cmd directly and issue persists

Received the following error

$ ndk-build
/cygdrive/c/android/android-ndk-r8c-windows/android-ndk-r8c/build/core/add-application.mk:128: Android NDK: WARNING: APP_PLATFORM android-14 is larger than android:minSdkVersion 7 in /cygdrive/c/REPOS/Androidtrunk/ciLibrary/AndroidManifest.xml
Cygwin         : Generating dependency file converter script
Compile++ thumb  : ciandroid <= CellRecord.cpp
Compile++ thumb  : ciandroid <= ci.cpp 
Compile++ thumb  : ciandroid <= ConnectionRecord.cpp
In file included from C:/REPOS/Androidtrunk/ciLibrary/jni/ciandroid/ConnectionRecord.cpp:8:0:
C:/REPOS/Androidtrunk/ciLibrary/jni/ciandroid/../data_common/ConnectionObserverData.h:23:19: fatal error: Redis.h: No such file or directory
compilation terminated.
/cygdrive/c/android/android-ndk-r8c-windows/android-ndk-r8c/build/core/build-binary.mk:263: recipe for target '/cygdrive/c/REPOS/Androidtrunk/ciLibrary/obj/local/armeabi/objs/ciandroid/ConnectionRecord.o' failed 
make: *** [/cygdrive/c/REPOS/Androidtrunk/ciLibrary/obj/local/armeabi/objs/ciandroid/ConnectionRecord.o] Error 1

NOTE :THE ABOVE ERROR WAS RESOLVED WHEN THE MISSING HEADER FILE REDIS.H was added however when the same file was run from LATEST NDK VERSION the same error shown below occurs.

Now changed the windows environment variable Path=C:\android\android-ndk-r9-windows-x86_64\android-ndk-r9\ and the error is

Android NDK: WARNING: APP_PLATFORM android-14 is larger than android:minSdkVersion 7 in /cygdrive/c/REPOS/Androidtrunk/ciLibrary/AndroidManifest.xml
Cygwin         : Generating dependency file converter script
Compile++ thumb  : catmgrd <= ActiveTestMgrAndroid.cpp
Compile++ thumb  : catmgrd <= ControlMsg.cpp
Compile++ thumb  : catmgrd <= DNSTObserver.cpp
Compile++ thumb  : catmgrd <= DnsTestDriver.cpp
Compile++ thumb  : catmgrd <= FileMoveActor.cpp
In file included from C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/../curl/include/curl/curl.h:35:0,
                 from C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/FileMoveActor.cpp:24:
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/../curl/include/curl/curlrules.h:79:4: error: #error "CURL_SIZEOF_LONG definition is missing!"
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/../curl/include/curl/curlrules.h:94:4: error: #error "CURL_TYPEOF_CURL_OFF_T definition is missing!"
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/../curl/include/curl/curlrules.h:99:4: error: #error "CURL_FORMAT_CURL_OFF_T definition is missing!"
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/../curl/include/curl/curlrules.h:104:4: error: #error "CURL_FORMAT_CURL_OFF_TU definition is missing!"
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/../curl/include/curl/curlrules.h:109:4: error: #error "CURL_FORMAT_OFF_T definition is missing!"
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/../curl/include/curl/curlrules.h:114:4: error: #error "CURL_SIZEOF_CURL_OFF_T definition is missing!"
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/../curl/include/curl/curlrules.h:119:4: error: #error "CURL_SUFFIX_CURL_OFF_T definition is missing!"
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/../curl/include/curl/curlrules.h:124:4: error: #error "CURL_SUFFIX_CURL_OFF_TU definition is missing!"
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/../curl/include/curl/curlrules.h:80:4: error: 'Error' does not name a type
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/../curl/include/curl/curlrules.h:153:6: error: 'curl_off_t' was not declared in this scope
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/../curl/include/curl/curlrules.h:153:6: error: 'CURL_SIZEOF_CURL_OFF_T' was not declared in this scope
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/../curl/include/curl/curlrules.h:163:6: error: 'curl_off_t' was not declared in this scope
In file included from C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/FileMoveActor.cpp:24:0:
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/../curl/include/curl/curl.h:235:3: error: 'curl_off_t' does not name a type
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/../curl/include/curl/curl.h:296:35: error: 'curl_off_t' has not been declared
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/FileMoveActor.cpp: In function 'int FileTransferRunCurl(FileTransferInfo*, char*, char const*, char const*, char const*)':
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/FileMoveActor.cpp:397:13: error: 'curl_off_t' was not declared in this scope
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/FileMoveActor.cpp: In function 'char* CreateTempFileName(char*)':
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/FileMoveActor.cpp:915:78: warning: format '%d' expects argument of type 'int', but argument 4 has type 'time_t {aka long int}' [-Wformat]
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/FileMoveActor.cpp:915:78: warning: format '%d' expects argument of type 'int', but argument 5 has type 'suseconds_t {aka long int}' [-Wformat]
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/FileMoveActor.cpp: In function 'int FileMoveActorRun(FileTransferInfo*)':
C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/FileMoveActor.cpp:1083:90: warning: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'long long int' [-Wformat]
/cygdrive/c/android/android-ndk-r9-windows-x86_64/android-ndk-r9/build/core/build-binary.mk:348: recipe for target '/cygdrive/c/REPOS/Androidtrunk/ciLibrary/obj/local/armeabi/objs/catmgrd/FileMoveActor.o' failed
make: *** [/cygdrive/c/REPOS/Androidtrunk/ciLibrary/obj/local/armeabi/objs/catmgrd/FileMoveActor.o] Error 1
-------------------------------------

Android.mk file has

include $(call all-subdir-makefiles)

android latest adt plugin is used.

Vyshakh Amarnath
  • 636
  • 6
  • 17
  • 1
    Do you run `ndk-build.cmd`, or the bash shell script? – Alex Cohn Oct 30 '13 at 21:22
  • 1
    possible duplicate of [Make error while trying to build NDK app](http://stackoverflow.com/questions/19527874/make-error-while-trying-to-build-ndk-app) – Alex Cohn Oct 31 '13 at 05:01
  • Tried ndk-build and the issue persists – Vyshakh Amarnath Oct 31 '13 at 09:14
  • Please open a new CMD window, set `PATH=C:\Windows`, and run `C:\android\android-ndk-r9-windows-x86_64\android-ndk-r9\ndk-build.cmd V=1`. If you are not satisfied with the result, show the output. – Alex Cohn Oct 31 '13 at 10:11
  • @AlexCohn Cohn I tried and the result is shown belowC:\Windows>C:\android\android-ndk-r9-windows-x86_64\android-ndk-r9\ndk-build.cmd V=1 Android NDK: Could not find application project directory ! Android NDK: Please define the NDK_PROJECT_PATH variable to point to it. C:\android\android-ndk-r9-windows-x86_64\android-ndk-r9\build/core/build-local.mk:130: *** Android NDK: Aborting . Stop. – Vyshakh Amarnath Oct 31 '13 at 10:46
  • Hi I tried resolving it by running in cmd and still the issue persists although the same project works fine in other computers.I believe it has go to do with some path setting or ndk settings? – Vyshakh Amarnath Oct 31 '13 at 12:37
  • Ok for ndk version 8b adding the missing header file resolved the problem.however the issue persists for ndk 9. – Vyshakh Amarnath Oct 31 '13 at 15:16
  • Sorry, I did not explain the crucial detail: you run `ndk-build` from the project root dir, e.g. `C:\REPOS\Androidtrunk\ciLibrary`. – Alex Cohn Nov 01 '13 at 20:17
  • For **curl**, you must run `configure`, see http://stackoverflow.com/questions/4952169/using-curl-in-android. And yes, this may have changed for NDK 9 toolchain. – Alex Cohn Nov 01 '13 at 20:22
  • @AlexCohn well running the command with command you specified for ndk-9 version gives the same error.C:/REPOS/Androidtrunk/ciLibrary/jni/catmgrd/../curl/include/curl/curlrules.h:79:4: error: #error "CURL_SIZEOF_LONG definition is missing!" – Vyshakh Amarnath Nov 03 '13 at 20:46
  • @AlexCohn this is already an existing build hence could you please let me know how to run configure again? do i have to run through cygwin again?Please excuse me as my knowledge in this is very low. – Vyshakh Amarnath Nov 03 '13 at 21:19
  • I would suggest to rebuild curl library from screatch with NDK r9 toolchain; I don't have specific experience about that. – Alex Cohn Nov 04 '13 at 14:55
  • Ah OK ...will try my luck with that – Vyshakh Amarnath Nov 05 '13 at 08:26

0 Answers0