6

error while loading shared libraries: libopencv_core.so.3.0: cannot open shared object file: No such file or directory.

I am using eclipse c/c++ ide on ubuntu 14.04. Tried everything which I got from google enter image description here enter image description here enter image description here enter image description here

Adarsh Nair
  • 370
  • 2
  • 4
  • 17
  • possible duplicate of [openCV program compile error "libopencv\_core.so.2.4: cannot open shared object file: No such file or directory" in ubuntu 12.04](http://stackoverflow.com/questions/12335848/opencv-program-compile-error-libopencv-core-so-2-4-cannot-open-shared-object-f) – Francisco Corrales Morales Jan 12 '15 at 19:37
  • tried that solution not working this error is for libopencv_core.so.3.0 and this version is for opencv2 – Adarsh Nair Jan 13 '15 at 10:40
  • Can u try `rapth` option Use -rpath option. In Eclipse CDT, right click on "DisplayImage" project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> C Linker -> Miscellaneous -> Other options and Add `-rpath "path to libopencv_core.so.3.0" or easier set LD_LIBRARY_PATH=path to so folder – kiranpradeep Jan 15 '15 at 06:42

2 Answers2

12

You are trying to run in Eclipse so the solution provided (The export part) in openCV program compile error "libopencv_core.so.2.4: cannot open shared object file: No such file or directory" in ubuntu 12.04 May not work. I suppose you have installed open cv following the instructions provided in open cv documentation. If so, you can get rid of this problem by adding the following environment variables to the eclipse runtime.

Name - LD_LIBRARY_PATH

Value - $LD_LIBRARY_PATH:/usr/local/lib

Steps

  1. Click on Run As -> Run Configurations
  2. On the window on the right hand side you see the Environment tab.

  3. Here click on New, you'll see a New Environment Variable pop up.

  4. Here, for Name enter LD_LIBRARY_PATH, for Value enter $LD_LIBRARY_PATH:/usr/local/lib. click ok and Apply
  5. Now run again, you shouldn't see the issue.

enter image description here

Community
  • 1
  • 1
Abbyss
  • 155
  • 1
  • 9
-2

I had the same problem too. Upgrading to the latest Eclipse version solved it.

BDL
  • 21,052
  • 22
  • 49
  • 55
Walker
  • 1