I try a basic example with QML - https://github.com/qmlnet/qmlnet And I need to fix this error , any idea ?
[mythcat@desk QML001]$ dotnet run Unhandled exception. System.TypeInitializationException: The type initializer for 'Qml.Net.Internal.Interop' threw an exception. ---> System.Exception: Library could not be loaded: /lib64/libQt5Core.so.5: version `Qt_5_PRIVATE_API' not found (required by /home/mythcat/CSharpProjects/QMLProjects/QML001/bin/Debug/net6.0/runtimes/linux-x64/native/libQmlNet.so): /home/mythcat/CSharpProjects/QMLProjects/QML001/bin/Debug/net6.0/runtimes/linux-x64/native/libQmlNet.so at NetNativeLibLoader.Loader.UnixPlatformLoader.LoadLibrary(String path, SymbolFlag flags) in NetNativeLibLoader.dll:token 0x6000035+0x6d at NetNativeLibLoader.Loader.UnixPlatformLoader.LoadLibraryInternal(String path) in NetNativeLibLoader.dll:token 0x6000036+0x0 at NetNativeLibLoader.Loader.PlatformLoaderBase.LoadLibrary(String path) in NetNativeLibLoader.dll:token 0x600002d+0x0 at Qml.Net.Internal.Interop..cctor() in Qml.Net.dll:token 0x600010e+0x92 --- End of inner exception stack trace --- at Qml.Net.Internal.Interop.get_NetVariantList() in Qml.Net.dll:token 0x6000118+0x0 at Qml.Net.Internal.Qml.NetVariantList..ctor() in Qml.Net.dll:token 0x6000379+0x0 at Qml.Net.QCoreApplication.Create(Int32 type, List`1 args, Int32 flags) in Qml.Net.dll:token 0x600003f+0x1b at Qml.Net.QCoreApplication..ctor(Int32 type, String[] args, Int32 flags) in Qml.Net.dll:token 0x6000025+0x16 at Qml.Net.QGuiApplication..ctor(String[] args, Int32 flags) in Qml.Net.dll:token 0x6000067+0x0 at QML001.Program.Main(String[] args) in /home/mythcat/CSharpProjects/QMLProjects/QML001/Program.cs:line 10 [mythcat@desk QML001]$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib64/libQt5Core.so.5
Hi,
Thanks for sharing this!
Cătălin George Feștilă catalinfest@gmail.com writes:
I try a basic example with QML - https://github.com/qmlnet/qmlnet And I need to fix this error , any idea ?
I think this is a bug in Qml.Net.
---> System.Exception: Library could not be loaded: /lib64/libQt5Core.so.5: version `Qt_5_PRIVATE_API' not found (required by /home/mythcat/CSharpProjects/QMLProjects/QML001/bin/Debug/net6.0/runtimes/linux-x64/native/libQmlNet.so): /home/mythcat/CSharpProjects/QMLProjects/QML001/bin/Debug/net6.0/runtimes/linux-x64/native/libQmlNet.so
This says that libQmlNet.so is trying to open libQt5Core.so.5 but couldn't find (symbols with?) version Qt_5_PRIVATE_API. That's the version in the libQt5Core.so that ships with Ubuntu.
I grabbed Ubuntu's libQt5core5a package [1] and looked at it locally:
$ eu-readelf -V ./usr/lib/x86_64-linux-gnu/libQt5Core.so.5.9.5 ... Version definition section [ 6] '.gnu.version_d' contains 13 entries: Addr: 0x0000000000062630 Offset: 0x062630 Link to section: [ 4] '.dynstr' 000000: Version: 1 Flags: BASE Index: 1 Cnt: 1 Name: libQt5Core.so.5 0x001c: Version: 1 Flags: none Index: 2 Cnt: 1 Name: Qt_5_PRIVATE_API ...
Fedora's libQt5Core.so.5 uses a different version: Qt_5.15.2_PRIVATE_API
$ eu-readelf -V /usr/lib64/libQt5Core.so.5 ... Version definition section [ 7] '.gnu.version_d' contains 19 entries: Addr: 0x0000000000074e70 Offset: 0x074e70 Link to section: [ 5] '.dynstr' 000000: Version: 1 Flags: BASE Index: 1 Cnt: 1 Name: libQt5Core.so.5 0x001c: Version: 1 Flags: none Index: 2 Cnt: 1 Name: Qt_5.15.2_PRIVATE_API ...
It looks like that Qml.Net has built their library in such a way that it requires an exact version which makes it only work on Ubuntu (and probably Debian). You should report this as a bug to them so they can fix this and make Qml.Net work on Fedora (and other Linux distributions) too.
[1] http://security.ubuntu.com/ubuntu/pool/main/q/qtbase-opensource-src/libqt5co...
Omair
-- PGP Key: B157A9F0 (http://pgp.mit.edu/) Fingerprint = 9DB5 2F0B FD3E C239 E108 E7BD DF99 7AF8 B157 A9F0
dotnet-sig@lists.fedoraproject.org