bytedeco / javacv-examples

Examples of using JavaCV / OpenCV library on Java Virtual Machine
341 stars 155 forks source link

java.lang.UnsatisfiedLinkError: no jniopencv_core in java.library.path #5

Closed pchundi closed 9 years ago

pchundi commented 9 years ago

Hi,

I cloned the javacv-examples project and tried running the first example within SBT. The code compiled and all repo's were resolved but am getting the following error when running the example.

[info] Running opencv2_cookbook.chapter01.Ex1MyFirstOpenCVApp 
[error] Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopencv_core in java.library.path
[error]     at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1865)
[error]     at java.lang.Runtime.loadLibrary0(Runtime.java:870)
[error]     at java.lang.System.loadLibrary(System.java:1122)
[error]     at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:536)
[error]     at org.bytedeco.javacpp.Loader.load(Loader.java:411)
[error]     at org.bytedeco.javacpp.Loader.load(Loader.java:354)
[error]     at org.bytedeco.javacpp.opencv_core.<clinit>(opencv_core.java:10)
[error]     at java.lang.Class.forName0(Native Method)
[error]     at java.lang.Class.forName(Class.java:348)
[error]     at org.bytedeco.javacpp.Loader.load(Loader.java:386)
[error]     at org.bytedeco.javacpp.Loader.load(Loader.java:354)
[error]     at org.bytedeco.javacpp.opencv_highgui.<clinit>(opencv_highgui.java:13)
[error]     at opencv2_cookbook.chapter01.Ex1MyFirstOpenCVApp$.delayedEndpoint$opencv2_cookbook$chapter01$Ex1MyFirstOpenCVApp$1(Ex1MyFirstOpenCVApp.scala:22)
[error]     at opencv2_cookbook.chapter01.Ex1MyFirstOpenCVApp$delayedInit$body.apply(Ex1MyFirstOpenCVApp.scala:19)
[error]     at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
[error]     at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
[error]     at scala.App$$anonfun$main$1.apply(App.scala:76)
[error]     at scala.App$$anonfun$main$1.apply(App.scala:76)
[error]     at scala.collection.immutable.List.foreach(List.scala:381)
[error]     at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
[error]     at scala.App$class.main(App.scala:76)
[error]     at opencv2_cookbook.chapter01.Ex1MyFirstOpenCVApp$.main(Ex1MyFirstOpenCVApp.scala:19)
[error]     at opencv2_cookbook.chapter01.Ex1MyFirstOpenCVApp.main(Ex1MyFirstOpenCVApp.scala)
[error] Caused by: java.lang.UnsatisfiedLinkError: /tmp/javacpp20650280539170/libjniopencv_core.so: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /tmp/javacpp20650280539170/libopencv_core.so.2.4)
[error]     at java.lang.ClassLoader$NativeLibrary.load(Native Method)
[error]     at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1937)
[error]     at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1822)
[error]     at java.lang.Runtime.load0(Runtime.java:809)
[error]     at java.lang.System.load(System.java:1086)
[error]     at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:525)
[error]     ... 19 more
pchundi commented 9 years ago

Never mind, I have solved it by upgrading the libstdc++. (found the solution here: http://stackoverflow.com/questions/19386651/how-to-fix-usr-lib-libstdc-so-6-version-glibcxx-3-4-15-not-found)

saudet commented 9 years ago

Related to issue https://github.com/bytedeco/javacpp-presets/issues/22 but most recent discussion is in https://github.com/bytedeco/javacpp-presets/issues/74

qweasdzxcpoi commented 7 years ago

@pchundi

Can you explain what you did. Because I was not able to follow that article.

pchundi commented 7 years ago

@qweasdzxcpoi I just updated the libstdc++ on my host. The version asked for in java stacktrace, was newer than what was installed on my host.