[GH-ISSUE #116] Not working on Linux #66

Closed
opened 2026-05-05 11:03:12 -06:00 by gitea-mirror · 11 comments
Owner

Originally created by @Ticky-Ticky on GitHub (Mar 26, 2019).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/116

Hello!
I have a problem with starting Qml.Net app on Linux (CentOs 7, x64).

App is crashing on start with error:

The type initializer for 'Qml.Net.Internal.Interop' threw an exception. ---> System.Exception: Library could not be loaded: libQt5QuickControls2.so.5: cannot open shared object file: No such file or directory: /home/myuser/myapp/libQmlNet.so

Both libQmlNet.so and libQt5QuickControls2.so.5 are exist in folder /home/myuser/myapp/
Can you help me?
Thanks in advance

Originally created by @Ticky-Ticky on GitHub (Mar 26, 2019). Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/116 Hello! I have a problem with starting Qml.Net app on Linux (CentOs 7, x64). App is crashing on start with error: > The type initializer for 'Qml.Net.Internal.Interop' threw an exception. ---> System.Exception: Library could not be loaded: libQt5QuickControls2.so.5: cannot open shared object file: No such file or directory: /home/myuser/myapp/libQmlNet.so Both libQmlNet.so and libQt5QuickControls2.so.5 are exist in folder /home/myuser/myapp/ Can you help me? Thanks in advance
Author
Owner

@MaxMommersteeg commented on GitHub (Mar 26, 2019):

Could you share a link to your code, so I can reproduce it locally?

<!-- gh-comment-id:476714779 --> @MaxMommersteeg commented on GitHub (Mar 26, 2019): Could you share a link to your code, so I can reproduce it locally?
Author
Owner

@Ticky-Ticky commented on GitHub (Mar 26, 2019):

I have this error with demo example: https://github.com/qmlnet/qmlnet-examples

<!-- gh-comment-id:476742506 --> @Ticky-Ticky commented on GitHub (Mar 26, 2019): I have this error with demo example: https://github.com/qmlnet/qmlnet-examples
Author
Owner

@Ticky-Ticky commented on GitHub (Mar 27, 2019):

Problem appears when you build a self-contained application with .net core libs included.
As far as I see there are some troubles with publishing self-contained qml.net application: there are no sub-folders in publish directory, all files and libs lay in one directory without any structure.

Also I can show log with L_DEBUG=all, if it is needed

<!-- gh-comment-id:477061357 --> @Ticky-Ticky commented on GitHub (Mar 27, 2019): Problem appears when you build a self-contained application with .net core libs included. As far as I see there are some troubles with publishing self-contained qml.net application: there are no sub-folders in publish directory, all files and libs lay in one directory without any structure. Also I can show log with L_DEBUG=all, if it is needed
Author
Owner

@norwynn commented on GitHub (Apr 6, 2019):

Somewhat new with .net core here. I got the same thing with the sample. Getting the error below:

image

Below is the output. Which folder should be copied over to linux (ubuntu 14.04 lts)?
image

I tried both. Publish with all the files, even the "missing" one in the error above. Am i missing something about the deployment of files?

<!-- gh-comment-id:480504182 --> @norwynn commented on GitHub (Apr 6, 2019): Somewhat new with .net core here. I got the same thing with the sample. Getting the error below: ![image](https://user-images.githubusercontent.com/20890162/55670089-89277c00-58b2-11e9-8d66-91faffaa48cb.png) Below is the output. Which folder should be copied over to linux (ubuntu 14.04 lts)? ![image](https://user-images.githubusercontent.com/20890162/55670037-c0e1f400-58b1-11e9-9571-b9788f16a4a4.png) I tried both. Publish with all the files, even the "missing" one in the error above. Am i missing something about the deployment of files?
Author
Owner

@pauldotknopf commented on GitHub (Apr 6, 2019):

Yeah, publishing self-contained apps isn't currently supported, because of how NuGet flattens directories when publishing.

See this issue.

I have plans to make the Qt environment not deployed as a part of the NuGet packages, and instead, a zip that is downloaded from some network location. The libQmlNet.so will still be deployed as a part of the NuGet packages though.

<!-- gh-comment-id:480507339 --> @pauldotknopf commented on GitHub (Apr 6, 2019): Yeah, publishing self-contained apps isn't currently supported, because of how NuGet flattens directories when publishing. See [this](https://github.com/dotnet/cli/issues/9794) issue. I have plans to make the Qt environment not deployed as a part of the NuGet packages, and instead, a zip that is downloaded from some network location. The ```libQmlNet.so``` will still be deployed as a part of the NuGet packages though.
Author
Owner

@norwynn commented on GitHub (Apr 6, 2019):

Hi,

These are the settings for the publish in VS, its now Framework dependent instead of self-contained.
image

Same as the screenshot from my previous comment above, which folder do I copy over to the target Linux environment? Publish or linux-x64?

<!-- gh-comment-id:480510771 --> @norwynn commented on GitHub (Apr 6, 2019): Hi, These are the settings for the publish in VS, its now Framework dependent instead of self-contained. ![image](https://user-images.githubusercontent.com/20890162/55671127-2092cc00-58bf-11e9-9a3f-fcc1d3a6b312.png) Same as the screenshot from my previous comment above, which folder do I copy over to the target Linux environment? **Publish** or **linux-x64**?
Author
Owner

@pauldotknopf commented on GitHub (Apr 10, 2019):

Now that I think about it, I think it will break in framework dependent mode too.

The solution would be to publish without the Qml.Net.*Binaries packages, and manually extract the Qml.Net.LinuxBinaries contents into the directory, preserving the directory structure.

The directory structure is important, and it is what get's destroyed when dotnet does it's publish.

This is a top priority to fix.

<!-- gh-comment-id:481499573 --> @pauldotknopf commented on GitHub (Apr 10, 2019): Now that I think about it, I think it will break in framework dependent mode too. The solution would be to publish without the ```Qml.Net.*Binaries``` packages, and manually extract the ```Qml.Net.LinuxBinaries``` contents into the directory, preserving the directory structure. The directory structure is important, and it is what get's destroyed when ```dotnet``` does it's publish. This is a top priority to fix.
Author
Owner

@pauldotknopf commented on GitHub (Apr 10, 2019):

This will be resolved as a part of #87

<!-- gh-comment-id:481501029 --> @pauldotknopf commented on GitHub (Apr 10, 2019): This will be resolved as a part of #87
Author
Owner

@pauldotknopf commented on GitHub (Apr 13, 2019):

This has been resolved as of version 0.8.0. You can checkout the latest examples for verification.

<!-- gh-comment-id:482894989 --> @pauldotknopf commented on GitHub (Apr 13, 2019): This has been resolved as of version ```0.8.0```. You can checkout the latest [examples](https://github.com/qmlnet/qmlnet-examples) for verification.
Author
Owner

@Ticky-Ticky commented on GitHub (Apr 15, 2019):

Thanks, now it works on linux! :)
But...
After updating to 0.9.0, the first app start takes very long time (both on Windows and Linux). The second and further starts are fast, even after reboot.
Before updating all starts were fast.

<!-- gh-comment-id:483168359 --> @Ticky-Ticky commented on GitHub (Apr 15, 2019): Thanks, now it works on linux! :) But... After updating to 0.9.0, the first app start takes very long time (both on Windows and Linux). The second and further starts are fast, even after reboot. Before updating all starts were fast.
Author
Owner

@pauldotknopf commented on GitHub (Apr 15, 2019):

After updating to 0.9.0, the first app start takes very long time (both on Windows and Linux).

Yup. That is the time it takes to auto-download a usable Qt runtime into the users directory. See this for more info.

Documentation hasn't been written yet, but you can get around this by deliverying the Qt runtime with your application. Extract a *-runtime.tar-gz to where your executable lives. It will get discovered/used.

<!-- gh-comment-id:483228323 --> @pauldotknopf commented on GitHub (Apr 15, 2019): > After updating to 0.9.0, the first app start takes very long time (both on Windows and Linux). Yup. That is the time it takes to auto-download a usable Qt runtime into the users directory. See [this](https://github.com/qmlnet/qmlnet/blob/11e09c0e67998c06415cac81039d7b1bd4818839/src/net/Qml.Net/Runtimes/RuntimeManager.Discovery.cs#L39) for more info. Documentation hasn't been written yet, but you can get around this by deliverying the Qt runtime with your application. Extract a [*-runtime.tar-gz](https://github.com/qmlnet/qt-runtimes/releases) to where your executable lives. It will get discovered/used.
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#66
No description provided.