[1.0] Eclipse shared library error on Ubuntu 64Bit

Asked by Southy

Hi,
I thought I had cracked the installation issues but clearly I have not!

I'm getting this error when I attempt to run in Eclipse:-
/usr/lib/jvm/java-1.7.0-openjdk-amd64/jre/bin/java: symbol lookup error: /home/userdir/Sikuli999/libs/libVisionProxy.so: undefined symbol: _ZN2cv6imreadERKSsi

public class SimpleBeta {
  public static void main(String[] args) {
    Screen s = new Screen();
    try{
     Thread.sleep(10000);
     s.click("/home/userdir/workspace/SikuliBeta/imgs/Selection_002.png", 0);
    }
    catch(Exception e){
     e.printStackTrace();
    }
  }
}

Any ideas,

Thanks,

Mark

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Uuups, looks like the libVisionProxy.so I packed with the Beta999 is not linked correctly.
Sorry :-(

I will check it and hopefully fix it with the upload of the final version the next hours.

Revision history for this message
RaiMan (raimund-hocke) said :
#2

the final version should work with an OpenCV 2.4 and Tesseract 3.02 installed in /usr/local/lib or /usr/lib

I am using Ubuntu 13.04, which has OpenCV 2.4 already installed. For installing Tesseract 3 apt-get install didi it.

Revision history for this message
Southy (mark-southward) said :
#3

Hi,
Firstly, thanks for all your efforts both for the software and support.

I must have something wrong in my Eclipse environment because after downloading the 1.0 version, I still have the same issue (same error).

Have you any suggestions.

Thanks,

Mark

Revision history for this message
RaiMan (raimund-hocke) said :
#4

ok, which Ubuntu is it exactly?

Revision history for this message
Southy (mark-southward) said :
#5

xubuntu 12.04 LTS

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.2 LTS
Release: 12.04
Codename: precise

3.5.0-30-generic #51~precise1-Ubuntu SMP Wed May 15 08:48:19 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
RaiMan (raimund-hocke) said :
#6

i have setup a supplemental package, that allows you to try to build libVisionProxy.so on your system your self:

https://launchpad.net/sikuli/sikuli-api/1.0.0/+download/Sikuli-1.0.0-Supplemental-LinuxVisionProxy.zip

all the best

Revision history for this message
Southy (mark-southward) said :
#7

Hi,
I've spent a couple of hours on this now and am defeated. The library paths are too dissimilar with the way my libraries have been installed and I don't know how to change them to make them work.
Maybe I will have another go tomorrow when I'm not as tired.

Thanks anyway,

Mark

Revision history for this message
RaiMan (raimund-hocke) said :
#8

The only path specs, that are set (and might be canged) in the build script are

1. the path to the installed and used Java SDK (given as parameter)
... this should be rather easy to find out

2. the path where the .so libs of OpenCV and Tesseract are stored (top of script)
... this might be usr/local/lib

the g++ should find the includes in the standard paths (/usr/include or use/local/include)

Revision history for this message
Southy (mark-southward) said :
#9

g++ was not finding the iclude files because the OpenCV installation was incorrect (it installed in /usr/local/include but the #include directives had part of the path structure where it was built from). I hand edited all the affected files (yes there were a lot) and it finally started to compile wihout file not found errors.
However, it fails now for lots of other reasons .....
An example:-

./makeVisionProxy /usr/lib/jvm/java-1.7.0-openjdk-amd64
compiling cvgui
src/cvgui.cpp: In static member function ‘static void Util::rgb2grayC3(const cv::Mat&, cv::Mat&)’:
src/cvgui.cpp:81:23: error: ‘CV_RGB2GRAY’ was not declared in this scope
src/cvgui.cpp: In static member function ‘static void Painter::drawBlobsRandomShading(cv::Mat&, std::vector<Blob>&)’:
src/cvgui.cpp:156:104: error: ‘CV_FILLED’ was not declared in this scope
src/cvgui.cpp: In static member function ‘static void cvgui::linkLineBlobsIntoPagagraphBlobs(std::vector<LineBlob>&, std::vector<ParagraphBlob>&)’:
src/cvgui.cpp:399:30: error: no matching function for call to ‘sort(std::vector<LineBlob>&, bool (&)(Blob, Blob))’
src/cvgui.cpp:399:30: note: candidates are:
/usr/local/include/core.hpp:421:19: note: void cv::sort(cv::InputArray, cv::OutputArray, int)
/usr/local/include/core.hpp:421:19: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/4.6/bits/stl_algo.h:5430:5: note: template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)
/usr/include/c++/4.6/bits/stl_algo.h:5394:5: note: template<class _RAIter> void std::sort(_RAIter, _RAIter)
src/cvgui.cpp: In static member function ‘static void cvgui::mergeLineBlobs(std::vector<LineBlob>&, std::vector<LineBlob>&)’:
src/cvgui.cpp:434:30: error: no matching function for call to ‘sort(std::vector<LineBlob>&, bool (&)(Blob, Blob))’
src/cvgui.cpp:434:30: note: candidates are:

Revision history for this message
RaiMan (raimund-hocke) said :
#10

I am now off at vacation until June 10th.

Hope you get it until then.
All the best.

Revision history for this message
Andrei Ciobanu (andreic9203) said :
#11

Hello,

Because I tried for 2 days to compiling libVisionProxy.so, I considered that because I done this, now is time write here how I did it.

Simple, just I downloaded the OpenCV 2.2.0, and I've compiled by myself and than, take a look into the makeVisionProxy, and you'll see some commented lines, that let you to set the JDK path and OpenCV libs path.
Edit them, and start ./makeVisionProxy.

Voila, is done!

Good luck!

Revision history for this message
RaiMan (raimund-hocke) said :
#12

@Andrei

Thanks for feedback.

Exactly as it should be ;-)

I will improve the scripts and docs with 1.1.0

What system?

Revision history for this message
Andrei Ciobanu (andreic9203) said :
#13

Hello, RaiMan

The system is Kubuntu 12.04. So, Ubuntu 12.04 + KDE.

Tomorrow I'll come back with a question for you:P.

Thanks for the answer.

Revision history for this message
Andrei Ciobanu (andreic9203) said :
#14

Hello RaiMan.

So, about my problem.
When I open the SikuliIDE, create some regions and start run, the sikuli crash with:
"[debug] ResourceLoaderBasic: loadLib: VisionProxy
[debug] ResourceLoaderBasic: loadLib: Found: VisionProxy
[error] ResourceLoaderBasic: loadLib: Fatal Error 110: loading: libVisionProxy.so
[error] ResourceLoaderBasic: loadLib: Since native library was found, it might be a problem with needed dependent libraries
/home/test/Development/kits/sikuli/sikuli_new/libs/libVisionProxy.so: libopencv_core.so.2.4: cannot open shared object file: No such file or directory
[error] Terminating SikuliX after a fatal error(110)! Sorry, but it makes no sense to continue!
If you do not have any idea about the error cause or solution, run again
with a Debug level of 3. You might paste the output to the Q&A board.
"

Can you give me a tip to resolve this?
If I'll figure out how to fix this, I'll post the solution.
Thanks.

Revision history for this message
RaiMan (raimund-hocke) said :
#15

above you mentioned, that you are using OpenCV 2.2.0, but the libVisionProxy.so complains about libopencv_core.so.2.4

So I doubt, that you are still using the bundled libVisionProxy.so, that is exported at runtime to the libs folder, when Sikuli thinks, that the libs folder should be updated.

A first step, to verify:
runIDE -d 3 -c

this will write debug output to the terminal window showing, what the IDE is doing at startup.

With version 1.0.1 it is a bit tricky with having your own libVisionProxy.so, so do this to succeed:
- after having setup SikuliX (in your case sikuli-ide.jar) delete the libs folder
- start the IDE with the above debug command, you should see the recreation with the bundled libVisionProxy.so
- stop the IDE
- replace the libVisionProxy.so in folder libs with your prepared one (do not touch the other files!)
- start the IDE again (the debug log should show, that the libs folder is not recreated but used as is)

now it should work.

With version 1.1.0 there will be a better solution for the usage of your own libVisionProxy.so.

Revision history for this message
Andrei Ciobanu (andreic9203) said :
#16

Yes, the inconsistency of the OpenCV 2.2.0 and libopencv_core.so.2.4 was because of my attempts. Firstly I tried with OpenCV 2.2.0 and then with OpenCV 2.4.0. I'm sorry for the wrong informations.

How I built the OpenCV, the problem was that to the Sikuli_supplemental I can set the path of the OpenCV libs, but the SikuliIDE, I think that, takes from the /usr/lib. Because following the opencv documentation I've installed it with
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
and the libs was put into /usr/local/libs and SikuliIDE wasn't saw them.

So, in the end, I've figured out how to make this work:
I don't needed anymore the Sikuli_supplemental. The problem was linked to the OpenCV installation.
I've compiled the OpenCV with
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr .. ( instead of /usr/local, I've put /usr )
and then, the java -jar sikuli-setup.jar was work like a charm.:)

So, problem solved for me.
If I can help you with more information, let me know.

Thanks for the answers and thanks for the support.

Have a nice day.

Revision history for this message
RaiMan (raimund-hocke) said :
#17

ok, thanks for feedback:

This is exactly, what I would have expected for an Ubuntu 12.04.

Can you help with this problem?

Provide an answer of your own, or ask Southy for more information if necessary.

To post a message you must log in.