devopvoid / webrtc-java

WebRTC for desktop platforms running Java
Apache License 2.0
248 stars 60 forks source link

Error from load GLIBCXX_3.4.26 on Debian 10 #27

Closed Stasyanych closed 2 years ago

Stasyanych commented 2 years ago

Describe the bug I am trying to run a JavaFX application on Debian 10 using the library webrtc. But i get an error on method NativeLoader.loadLibrary("webrtc-java").

To Reproduce Steps to reproduce the behavior:

  1. try to run application on Debian 10
  2. See error Exception in thread "DefaultDispatcher-worker-7" java.lang.UnsatisfiedLinkError: /tmp/libwebrtc-java12212360751322587716.so: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: versionGLIBCXX_3.4.26' not found (required by /tmp/libwebrtc-java12212360751322587716.so) at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method) at java.base/java.lang.ClassLoader$NativeLibrary.load(Unknown Source) at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(Unknown Source) at java.base/java.lang.ClassLoader.loadLibrary0(Unknown Source) at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source) at java.base/java.lang.Runtime.load0(Unknown Source) at java.base/java.lang.System.load(Unknown Source) at dev.onvoid.webrtc.internal.NativeLoader.loadLibrary(NativeLoader.java:71) at dev.onvoid.webrtc.PeerConnectionFactory.(PeerConnectionFactory.java:41) at com.buhphone.desktop.data.services.media.MediaService.onCallStarted(MediaService.kt:376) at com.buhphone.desktop.data.services.call.CallService$onRegisteredOK$1.invokeSuspend(CallService.kt:226) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)`

command strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX give this GLIBCXX_3.4 GLIBCXX_3.4.1 GLIBCXX_3.4.2 GLIBCXX_3.4.3 GLIBCXX_3.4.4 GLIBCXX_3.4.5 GLIBCXX_3.4.6 GLIBCXX_3.4.7 GLIBCXX_3.4.8 GLIBCXX_3.4.9 GLIBCXX_3.4.10 GLIBCXX_3.4.11 GLIBCXX_3.4.12 GLIBCXX_3.4.13 GLIBCXX_3.4.14 GLIBCXX_3.4.15 GLIBCXX_3.4.16 GLIBCXX_3.4.17 GLIBCXX_3.4.18 GLIBCXX_3.4.19 GLIBCXX_3.4.20 GLIBCXX_3.4.21 GLIBCXX_3.4.22 GLIBCXX_3.4.23 GLIBCXX_3.4.24 GLIBCXX_3.4.25 GLIBCXX_DEBUG_MESSAGE_LENGTH

There is no library version 3.4.26 in the system and therefore the application cannot load webrtc-java.

Expected behavior I expect that webrtc-java will load correctly

Desktop (please complete the following information):

Additional context How to solve this problem? Is it possible to make a static linking of the desired version of the library on Linux? Or maybe there is another solution

devopvoid commented 2 years ago

Thanks @Stasyanych

right, the Linux version is compiled with the latest libstdc++. There are two options to fix this. Either compile with an older version of libstdc++ or static linking. I'll give it a try by going back to GLIBCXX_3.4.20. This should work with all distros.

I will come back at you, when done.