[GH-ISSUE #191] Did not understand how to run app #123

Closed
opened 2026-05-05 11:05:47 -06:00 by gitea-mirror · 13 comments
Owner

Originally created by @EarsKilla on GitHub (Apr 17, 2020).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/191

Project was created with dotnet new console, included all required packages from readme (including windows, mac, linux libs)

RuntimeManager.DiscoverOrDownloadSuitableQtRuntime() throwing following exception:

An unhandled exception of type 'System.DllNotFoundException' occurred in NetNativeLibLoader.dll: 'Unable to load shared library 'dl' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libdl: cannot open shared object file: No such file or directory'

Trying to run on Linux Mint 19.3 Tricia using net core 3.1

Getting same exception with qmlnet-examples


run logs with LD_DEBUG=all.txt
If my project is required for some reasons: testqt.zip

Originally created by @EarsKilla on GitHub (Apr 17, 2020). Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/191 Project was created with `dotnet new console`, included all required packages from readme (including windows, mac, linux libs) `RuntimeManager.DiscoverOrDownloadSuitableQtRuntime()` throwing following exception: ``` An unhandled exception of type 'System.DllNotFoundException' occurred in NetNativeLibLoader.dll: 'Unable to load shared library 'dl' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libdl: cannot open shared object file: No such file or directory' ``` Trying to run on `Linux Mint 19.3 Tricia` using `net core 3.1` Getting same exception with [qmlnet-examples](https://github.com/qmlnet/qmlnet-examples) --- [run logs with LD_DEBUG=all.txt](https://github.com/qmlnet/qmlnet/files/4493559/run.logs.with.LD_DEBUG.all.txt) If my project is required for some reasons: [testqt.zip](https://github.com/qmlnet/qmlnet/files/4493574/testqt.zip)
Author
Owner

@r9guy commented on GitHub (Apr 20, 2020):

same here.
I fought it should be straightforward, add nuget, build and all runs.
did vith VS2019 .NET Core 3

<!-- gh-comment-id:616712260 --> @r9guy commented on GitHub (Apr 20, 2020): same here. I fought it should be straightforward, add nuget, build and all runs. did vith VS2019 .NET Core 3
Author
Owner

@pauldotknopf commented on GitHub (Apr 20, 2020):

Sorry for the delay.

I'm not really sure what is causing your issue.

It seems that .NET can't find libdl.so, which should be present in your distribution.

Is it possible there is a mixup between /lib and /lib64? Maybe symlink the two and try again?

<!-- gh-comment-id:616759991 --> @pauldotknopf commented on GitHub (Apr 20, 2020): Sorry for the delay. I'm not really sure what is causing your issue. It seems that .NET can't find ```libdl.so```, which should be present in your distribution. Is it possible there is a mixup between ```/lib``` and ```/lib64```? Maybe symlink the two and try again?
Author
Owner

@EarsKilla commented on GitHub (Apr 21, 2020):

Solved!

Seems that my system don't contains libdl.so which is included in libc6-dev package (found in google here)

After installation libc6-dev package and it's dependencies i was able to start app.

Please, include in readme note about libc6-dev for linux

<!-- gh-comment-id:616992456 --> @EarsKilla commented on GitHub (Apr 21, 2020): Solved! Seems that my system don't contains `libdl.so` which is included in `libc6-dev` package (found in google [here](https://askubuntu.com/questions/987740/how-to-install-dl#comment1591148_987740)) After installation `libc6-dev` package and it's dependencies i was able to start app. Please, include in readme note about `libc6-dev` for linux
Author
Owner

@vadi2 commented on GitHub (Apr 21, 2020):

Could you send in a PR for that?

<!-- gh-comment-id:616999888 --> @vadi2 commented on GitHub (Apr 21, 2020): Could you send in a PR for that?
Author
Owner

@EarsKilla commented on GitHub (Apr 21, 2020):

@vadi2 done #193

<!-- gh-comment-id:617011193 --> @EarsKilla commented on GitHub (Apr 21, 2020): @vadi2 done #193
Author
Owner

@r9guy commented on GitHub (Apr 21, 2020):

what about windows? I have same Exception on windows.

<!-- gh-comment-id:617302983 --> @r9guy commented on GitHub (Apr 21, 2020): what about windows? I have same Exception on windows.
Author
Owner

@vadi2 commented on GitHub (Apr 21, 2020):

Are you certain it's the same?

<!-- gh-comment-id:617327352 --> @vadi2 commented on GitHub (Apr 21, 2020): Are you certain it's the same?
Author
Owner

@r9guy commented on GitHub (Apr 21, 2020):

this is the full exception.
nuget package version 0.10.1
System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'Qml.Net.Internal.Interop' threw an exception.
Source=Qml.Net
StackTrace:
at Qml.Net.Internal.Interop.get_NetVariantList()
at Qml.Net.Internal.Qml.NetVariantList..ctor()
at Qml.Net.QCoreApplication.Create(Int32 type, List`1 args, Int32 flags)
at Qml.Net.QCoreApplication..ctor(Int32 type, String[] args, Int32 flags)
at Qml.Net.QGuiApplication..ctor(String[] args, Int32 flags)
at QMLTest.Program.Main(String[] args) in C:\Users\Arsham\source\repos\QMLTest\Program.cs:line 11

This exception was originally thrown at this call stack:
[External Code]

Inner Exception 1:
Exception: Unable to find the native Qml.Net library. Try calling "RuntimeManager.DiscoverOrDownloadSuitableQtRuntime();" in Program.Main()

<!-- gh-comment-id:617338149 --> @r9guy commented on GitHub (Apr 21, 2020): this is the full exception. nuget package version 0.10.1 System.TypeInitializationException HResult=0x80131534 Message=The type initializer for 'Qml.Net.Internal.Interop' threw an exception. Source=Qml.Net StackTrace: at Qml.Net.Internal.Interop.get_NetVariantList() at Qml.Net.Internal.Qml.NetVariantList..ctor() at Qml.Net.QCoreApplication.Create(Int32 type, List`1 args, Int32 flags) at Qml.Net.QCoreApplication..ctor(Int32 type, String[] args, Int32 flags) at Qml.Net.QGuiApplication..ctor(String[] args, Int32 flags) at QMLTest.Program.Main(String[] args) in C:\Users\Arsham\source\repos\QMLTest\Program.cs:line 11 This exception was originally thrown at this call stack: [External Code] Inner Exception 1: Exception: Unable to find the native Qml.Net library. Try calling "RuntimeManager.DiscoverOrDownloadSuitableQtRuntime();" in Program.Main()
Author
Owner

@vadi2 commented on GitHub (Apr 21, 2020):

See it's different. Are you doing what it's telling you to do?

<!-- gh-comment-id:617341857 --> @vadi2 commented on GitHub (Apr 21, 2020): See it's different. Are you doing what it's telling you to do?
Author
Owner

@r9guy commented on GitHub (Apr 21, 2020):

Dear Vadim.
my apologies. after closer look I have seen that the exception is indeed different and my intention to post was based on the title of issue itself.
anyway regarding what I do. I just created a console .netcore application, added nuget QML.NET and QML.NET Windows binaries.
just exactly as is described in here
my program is exactly as is given in managed hosting setup page.
I don't know what could be wrong from my end.
project is zipped and attached
QMLTest.zip

<!-- gh-comment-id:617351794 --> @r9guy commented on GitHub (Apr 21, 2020): Dear Vadim. my apologies. after closer look I have seen that the exception is indeed different and my intention to post was based on the title of issue itself. anyway regarding what I do. I just created a console .netcore application, added nuget QML.NET and QML.NET Windows binaries. just exactly as is described in [here](https://qmlnet.github.io/setup/managed-hosting/) my program is exactly as is given in managed hosting setup page. I don't know what could be wrong from my end. project is zipped and attached [QMLTest.zip](https://github.com/qmlnet/qmlnet/files/4512090/QMLTest.zip)
Author
Owner

@r9guy commented on GitHub (Apr 21, 2020):

found that my code was different from @EarsKilla 's that it is missing RuntimeManager.DiscoverOrDownloadSuitableQtRuntime();

added that . now there's no exception, it is not documented on website but on issue #143 .

<!-- gh-comment-id:617356697 --> @r9guy commented on GitHub (Apr 21, 2020): found that my code was different from @EarsKilla 's that it is missing `RuntimeManager.DiscoverOrDownloadSuitableQtRuntime();` added that . now there's no exception, it is not documented on website but on issue #143 .
Author
Owner

@EarsKilla commented on GitHub (Apr 21, 2020):

@r9guy

it is not documented on website

it's documented in readme below Define a .NET type (POCO)

<!-- gh-comment-id:617371100 --> @EarsKilla commented on GitHub (Apr 21, 2020): @r9guy > it is not documented on website it's documented in [readme](https://github.com/qmlnet/qmlnet#quick-overview) below `Define a .NET type (POCO)`
Author
Owner

@r9guy commented on GitHub (Apr 21, 2020):

@EarsKilla @vadi2 thanks. that helped

<!-- gh-comment-id:617387195 --> @r9guy commented on GitHub (Apr 21, 2020): @EarsKilla @vadi2 thanks. that helped
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#123
No description provided.