OpenCV-Android icon indicating copy to clipboard operation
OpenCV-Android copied to clipboard

Unable to build on Windows

Open akulapid opened this issue 14 years ago • 6 comments

I'm trying to build this on Windows using cygwin with ndk r5 and sdk 2.1/2.2. I have OpenCV 2.2 installed and in PATH as well. I get the following error.

StaticLibrary  : libcvhighgui.a
SharedLibrary  : libopencv.so
E:/dev/android-ndk-r5/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld.exe: cannot find - lcxcore
collect2: ld returned 1 exit status
make: *** [/cygdrive/e/code/droid/billmcord/first-push/OpenCV-Android/obj/local/armeabi/libopencv.so] Error 1

akulapid avatar Jan 10 '11 17:01 akulapid

Having OpenCV 2.2. installed and in PATH is irrelevant. We use OpenCV 1.1 pre for this project and the source is already included and built when you build. Someone else has also reported the same problem you are running into, but unfortunately I don't have a Windows machine to debug this. The other person eventually gave up and used Linux to build. If that isn't an option for you, then I would appreciate your help investigating. Here are the instructions I gave to the other person:

Everything built except for the opencv module which requires linking to all of the other libraries. The only thing I can guess is that one of two things is happening:

* On your machine TARGET_OUT is not pointing to [ROOT OF OPENCV PRJ]/obj/local/armeabi
      o You might try hard-coding the path in there and removing -L$(TARGET_OUT).  See if that works.  If it doesn't then the other problem might be...
* ld.exe isn't respecting that -lcxcore is a reference to libcxcore.a
      o You might try reading the documentation for ld.exe and see if there are some rules that are different about the Windows implementation from the Linux / Mac implementation.

Let me know if you make any progress as I would like to warn others.

billmccord avatar Jan 11 '11 05:01 billmccord

I struggled with this for way to long now and finally it worked. Setting the search path with -L to an absolute path instead of TARGET_OUT helped.

LOCAL_LDLIBS := -L $(SYSROOT)/usr/lib -l dl -l log \
        -L "D:\OpenCV-Android\obj\local\armeabi" \
        -l cxcore -l cv -l cvaux -l cvml -l cvhighgui

brnhffmnn avatar Jun 24 '11 14:06 brnhffmnn

Hello I had the same problem and this solution helped me out... I just wonder if is there a neater way to do it... thanks

Xirus avatar Aug 07 '11 05:08 Xirus

Xirus,

I'm stuck on Android 1.6 platform because the project I am working on requires it for now. You might want to look at the official OpenCV project by Willow Garage if you are able to use newer versions of Android. http://opencv.willowgarage.com/wiki/Android

billmccord avatar Aug 07 '11 05:08 billmccord

Thanks - I will have a look. Another problem: I am trying the open the OpenCVSample project with eclipse. I just started with Android so perhaps I am doing something wrong. Thanks Jay

-----Original Message----- From: billmccord [mailto:[email protected]] Sent: Sunday, August 07, 2011 1:49 AM To: [email protected] Subject: Re: [OpenCV-Android] Unable to build on Windows (#18)

Xirus,

I'm stuck on Android 1.6 platform because the project I am working on requires it for now. You might want to look at the official OpenCV project by Willow Garage if you are able to use newer versions of Android. http://opencv.willowgarage.com/wiki/Android

Reply to this email directly or view it on GitHub: https://github.com/billmccord/OpenCV-Android/issues/18#issuecomment-1747546

Xirus avatar Aug 07 '11 06:08 Xirus

You haven't described the problem you are seeing? You are trying to open the OpenCVSample and ... what?

billmccord avatar Aug 07 '11 08:08 billmccord