[GH-ISSUE #241] libQmlNet.so: undefined symbol on newer Linux #154

Closed
opened 2026-05-05 11:07:01 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @hengestone on GitHub (Jul 1, 2021).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/241

Trying to run an example on Ubuntu 21.04 I get:

$> dotnet run

Unhandled exception. System.TypeInitializationException: 
The type initializer for 'Qml.Net.Internal.Interop' threw an exception.
 ---> System.Exception: Library could not be loaded: 
***/qt/qmldotnet/bin/Debug/net5.0/runtimes/linux-x64/native/libQmlNet.so: undefined symbol:
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm, version Qt_5

The symbol is defined in libstdc++.so.6.0.29 as expected. And libdl.so.2 is available and loaded when the above is run (from strace output).

My suspicion is that Qml.Net.LinuxBinaries needs to be rebuilt, but I'm not sure.

Any ideas?
Thanks!

Originally created by @hengestone on GitHub (Jul 1, 2021). Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/241 Trying to run an example on Ubuntu 21.04 I get: ``` $> dotnet run Unhandled exception. System.TypeInitializationException: The type initializer for 'Qml.Net.Internal.Interop' threw an exception. ---> System.Exception: Library could not be loaded: ***/qt/qmldotnet/bin/Debug/net5.0/runtimes/linux-x64/native/libQmlNet.so: undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm, version Qt_5 ``` The symbol is defined in `libstdc++.so.6.0.29` as expected. And `libdl.so.2` is available and loaded when the above is run (from strace output). My suspicion is that `Qml.Net.LinuxBinaries` needs to be rebuilt, but I'm not sure. Any ideas? Thanks!
Author
Owner

@pauldotknopf commented on GitHub (Jul 7, 2021):

Ya, it needs to be rebuilt. I'm guessing gcc is different/newer on Ubuntu 21.04.

<!-- gh-comment-id:875242067 --> @pauldotknopf commented on GitHub (Jul 7, 2021): Ya, it needs to be rebuilt. I'm guessing gcc is different/newer on Ubuntu 21.04.
Author
Owner

@hengestone commented on GitHub (Jul 12, 2021):

What is the best way to handle that? Build a custom version on MyGet and reference it in the project file? Or is there a way to rebuild the dependency locally? (I tried to find the answer in the dot net docs :-/ )

<!-- gh-comment-id:877962742 --> @hengestone commented on GitHub (Jul 12, 2021): What is the best way to handle that? Build a custom version on MyGet and reference it in the project file? Or is there a way to rebuild the dependency locally? (I tried to find the answer in the dot net docs :-/ )
Author
Owner

@pauldotknopf commented on GitHub (Jul 13, 2021):

The best bet is to avoid installing any of the *.Native* nuget packages, and build libQmlnet.so locally and put it in /usr/local/lib (or wherever it needs to be).

<!-- gh-comment-id:879359840 --> @pauldotknopf commented on GitHub (Jul 13, 2021): The best bet is to avoid installing any of the ```*.Native*``` nuget packages, and build ```libQmlnet.so``` locally and put it in ```/usr/local/lib``` (or wherever it needs to be).
Author
Owner

@hengestone commented on GitHub (Jul 15, 2021):

Thanks :)

<!-- gh-comment-id:880849514 --> @hengestone commented on GitHub (Jul 15, 2021): Thanks :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/qmlnet#154
No description provided.