1

I have checked a lot of threads already but none of them seems to solve my problem. I'm working on a project regarding my study and want to use the OpenCV library with my Android app. Here is a list of the programs and tools I use:

  • Eclipse IDE for Java Developers (3.7.0)
  • Android SDK r16
  • OpenCV 2.3.1
  • Android NDK r7b

I am following a tutorial, and everything works fine until the part where I need the NDK for using C++ OpenCV code. I can code and run Android apps and the "Tutorial 1" samples from the OpenCV 2.3.1 are working fine. However the "Tutorial 2" samples won't work. I tried following the steps in the C++ part of the tutorial.

When I try to run the NDK-build (tried both the command line and Eclipse part) I keep getting this error:

/usr/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [obj/local/armeabi/objs/opencv/cvjni.o] Error 1

Does anyone has a solution for my problem? Thanks in advance

Matt
  • 74,352
  • 26
  • 153
  • 180
pimmes111
  • 200
  • 4
  • 11

1 Answers1

1

in bash script unexpected "syntax error: unexpected end of file" on if statement

Make sure your shell scripts use Unix-style line endings

Community
  • 1
  • 1
plan9assembler
  • 2,862
  • 1
  • 24
  • 13
  • Thanks for the help. However i have no idea how to fix the problem while using Command Prompt. Instead I used Cygwin with the following commands: First navigate to your project folder: cd /cygdrive/c/androidDevelopment/android-opencv/TestOpenCV/ While in this folder use the path to your ndk-build file: /cygdrive/c/androidDevelopment/android-ndk-r7b/ndk-build It starts compiling and after that I can run the app on my tablet – pimmes111 Mar 08 '12 at 12:20