[GH-ISSUE #180] Wiki - First step - dependencies #115

Closed
opened 2026-05-05 11:05:30 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @vslmc on GitHub (Dec 28, 2019).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/180

The lack of documentation is surprising, I'm new to all of this so It confuses me alot how to even beginn a project.
Could someone have a look and verify which modules need to be installed for a minimal Qml.Net to work, And add this to a wiki?

Additional Questions:
Does Visual Studio need all these C++ dependencies if QT have them?
Is there a way to simple choose between MSVC and MinGW ?

(Minimal build consider only Windows x64; Linux and Mac, x86 and arm64 as optional modules)

  • Install Visual Studio

Install Net Core 3.0-Runtime
Install Net Core 3.1 SDK
Install Net Framework 4.7.2 - targeting pack
Install Net Framework 4.8 SDK
Install Package for setting target versions of Net Framework 4.6.1
Install Package for setting target versions of Net Framework 4.8
Install CLR for SQL Server
Install Dependency Validation
Install NuGet-Paket-Manager
Install Text Template Transformation
Install C# & Visual Basic Rosyln-Compiler
Install C++ 2019 Redistributable MSMs
Install C++ 2019 Redistributable Update
Install C++/CLI Support for v142-Buildtools 14.24
Install C++ CMake Tools for Windows
Install MSBuild
Install MSVC v142 - VS 2019 C++ x64/x86 Buildtools
Install .Net Profiling Tools
Install C++ Profiling Tools
Install JIT Debugger
Install C# & Visual Basic
Install C++ Core features
Install IntelliCode
Install C++ ATL v142-Buildtools for x64/x86
Install C++ MFC v142-Buildtools for x64/x86
Optional: Install Net Native
Optional: Install Net Compiler Platform SDK
Optional: Install C++ Module for v142-Buildtools
Optional: Install C++ UWP v142-Buildtools for ARM64
Optional: Install MSVC v142 - VS 2019 C++ ARM64 Buildtools
Optional: Install MSVC v142 - VS 2019 C++ x64/x86 Buildtools Spectre
Optional: Install C++ for Linux Development
Optional: Install C++ CMake Tools for Linux
Optional: Install Embedded & IoT Development tools
Optional: Install C++ ATL v142-Buildtools for ARM64
Optional: Install C++ MFC v142-Buildtools for ARM64
Optional: Install Entity Framework 6-Tools
Optional: Install USB Support
Optional: Install Windows 10 SDK
Optional: Install Windows Universal C-Runtime

  • 1. Install QT

Optional: Enable Preview Packages
Install QT Creator
Install QT 5.xx.x (Newest version)
Install Developer and Designer Tools / QT Creator Debugger Support
Install Developer and Designer Tools / Debbuging Tools for Windows
Install Developer and Designer Tools / MinGW 7.3.0 64-bit
Install Developer and Designer Tools / CMake 3.16.0 64-bit
Optional: Install Developer and Designer Tools / QT Installer Framework (Or similiar publishing packaging solution)

  • Add QT to Environment Variables
REM Set up Microsoft Visual Studio 2017, where <arch> is amd64, x86, etc.
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" <arch>
SET _ROOT=C:\Qt\Qt-5
SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%
REM Uncomment the below line when using a git checkout of the source repository
REM SET PATH=%_ROOT%\qtrepotools\bin;%PATH%
SET _ROOT=

configure -debug -nomake examples -nomake tests -skip qtwebengine -opensource

nmake
or
mingw32-make

  • Install Qml.Net
dotnet add package Qml.Net
dotnet add package Qml.Net.WindowsBinaries

Optional:

dotnet add package Qml.Net.OSXBinaries
dotnet add package Qml.Net.LinuxBinaries
Originally created by @vslmc on GitHub (Dec 28, 2019). Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/180 The lack of documentation is surprising, I'm new to all of this so It confuses me alot how to even beginn a project. Could someone have a look and verify which modules need to be installed for a **minimal** Qml.Net to work, And add this to a wiki? Additional Questions: Does Visual Studio need all these C++ dependencies if QT have them? Is there a way to simple choose between MSVC and MinGW ? (Minimal build consider only Windows x64; Linux and Mac, x86 and arm64 as optional modules) - **Install Visual Studio** Install Net Core 3.0-Runtime Install Net Core 3.1 SDK Install Net Framework 4.7.2 - targeting pack Install Net Framework 4.8 SDK Install Package for setting target versions of Net Framework 4.6.1 Install Package for setting target versions of Net Framework 4.8 Install CLR for SQL Server Install Dependency Validation Install NuGet-Paket-Manager Install Text Template Transformation Install C# & Visual Basic Rosyln-Compiler Install C++ 2019 Redistributable MSMs Install C++ 2019 Redistributable Update Install C++/CLI Support for v142-Buildtools 14.24 Install C++ CMake Tools for Windows Install MSBuild Install MSVC v142 - VS 2019 C++ x64/x86 Buildtools Install .Net Profiling Tools Install C++ Profiling Tools Install JIT Debugger Install C# & Visual Basic Install C++ Core features Install IntelliCode Install C++ ATL v142-Buildtools for x64/x86 Install C++ MFC v142-Buildtools for x64/x86 Optional: Install Net Native Optional: Install Net Compiler Platform SDK Optional: Install C++ Module for v142-Buildtools Optional: Install C++ UWP v142-Buildtools for ARM64 Optional: Install MSVC v142 - VS 2019 C++ ARM64 Buildtools Optional: Install MSVC v142 - VS 2019 C++ x64/x86 Buildtools Spectre Optional: Install C++ for Linux Development Optional: Install C++ CMake Tools for Linux Optional: Install Embedded & IoT Development tools Optional: Install C++ ATL v142-Buildtools for ARM64 Optional: Install C++ MFC v142-Buildtools for ARM64 Optional: Install Entity Framework 6-Tools Optional: Install USB Support Optional: Install Windows 10 SDK Optional: Install Windows Universal C-Runtime - **1. Install QT** Optional: Enable Preview Packages Install QT Creator Install QT 5.xx.x (Newest version) Install Developer and Designer Tools / QT Creator Debugger Support Install Developer and Designer Tools / Debbuging Tools for Windows Install Developer and Designer Tools / MinGW 7.3.0 64-bit Install Developer and Designer Tools / CMake 3.16.0 64-bit Optional: Install Developer and Designer Tools / QT Installer Framework (Or similiar publishing packaging solution) - **Add QT to Environment Variables** ``` REM Set up Microsoft Visual Studio 2017, where <arch> is amd64, x86, etc. CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" <arch> SET _ROOT=C:\Qt\Qt-5 SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH% REM Uncomment the below line when using a git checkout of the source repository REM SET PATH=%_ROOT%\qtrepotools\bin;%PATH% SET _ROOT= ``` - **Configure and Build QT (https://doc.qt.io/qt-5/configure-options.html)** `configure -debug -nomake examples -nomake tests -skip qtwebengine -opensource` `nmake` or `mingw32-make` - **Install Qml.Net** ``` dotnet add package Qml.Net dotnet add package Qml.Net.WindowsBinaries ``` Optional: ``` dotnet add package Qml.Net.OSXBinaries dotnet add package Qml.Net.LinuxBinaries ```
Author
Owner

@pauldotknopf commented on GitHub (Dec 28, 2019):

Woah. So, yeah, we don't have the documentation you are looking for. This project isn't 1.0 yet, and it is currently a one-man show at the moment. Even with that said, it isn't likely to ever have the level of documentation you are looking for, being out of scope.

Again, with that said, allow me to help the best I can.

  1. Qml.Net has to different hosting models, managed and unmanaged hosting (see here).
  2. Since you are trying to compile Qt yourself, to know what modules are needed, it's best to consult the .pri file here. You'll need these modules: gui qml core-private quickcontrols2 widgets testlib.
  3. If you are compiling Qt yourself, you don't need to install the Qml.Net.*Binaries binaries. You just need to make sure you compile the QmlNet.[so|dll] file yourself with your Qt runtime, and make sure that lib is available via your PATH/LD_LIBRARY_PATH/etc.
<!-- gh-comment-id:569443350 --> @pauldotknopf commented on GitHub (Dec 28, 2019): Woah. So, yeah, we don't have the documentation you are looking for. This project isn't 1.0 yet, and it is currently a one-man show at the moment. Even with that said, it isn't likely to ever have the level of documentation you are looking for, being out of scope. Again, with that said, allow me to help the best I can. 1. Qml.Net has to different hosting models, managed and unmanaged hosting (see [here](https://qmlnet.github.io/setup/)). 2. Since you are trying to compile Qt yourself, to know what modules are needed, it's best to consult the .pri file [here](https://github.com/qmlnet/qmlnet/blob/develop/src/native/QmlNet/QmlNet.pri). You'll need these modules: ```gui qml core-private quickcontrols2 widgets testlib```. 3. If you are compiling Qt yourself, you don't need to install the ```Qml.Net.*Binaries``` binaries. You just need to make sure you compile the ```QmlNet.[so|dll]``` file yourself with your Qt runtime, and make sure that lib is available via your ```PATH```/```LD_LIBRARY_PATH```/etc.
Author
Owner

@vslmc commented on GitHub (Dec 29, 2019):

@pauldotknopf Thank you for the response and your time. I was aware of qmlnet.github.io but was suprised that it did not give me the infos I needed to set up both IDEs
If I would create a beginning guide would you include it? As I want to start from scratch (with a new pc) I need to manage anyway, how to set up everything correctly; why not document this while I proceed. Atleast for a 'Windows x64 from source' start guide for beginners.

Are all modules linked in the makefile configuration already installed with the normal Qt installation?
And does Visual Studio need all these C++ dependencies if QT have them? I would like to reduce the footprint of these IDEs

<!-- gh-comment-id:569469668 --> @vslmc commented on GitHub (Dec 29, 2019): @pauldotknopf Thank you for the response and your time. I was aware of qmlnet.github.io but was suprised that it did not give me the infos I needed to set up both IDEs If I would create a beginning guide would you include it? As I want to start from scratch (with a new pc) I need to manage anyway, how to set up everything correctly; why not document this while I proceed. Atleast for a 'Windows x64 from source' start guide for beginners. Are all modules linked in the makefile configuration already installed with the normal Qt installation? And does Visual Studio need all these C++ dependencies if QT have them? I would like to reduce the footprint of these IDEs
Author
Owner

@pauldotknopf commented on GitHub (Dec 29, 2019):

If I would create a beginning guide would you include it?

I'm not sure what you mean exactly by this. There isn't any advanced setup. You don't need to compile any C++ stuff yourself, unless you are compiling your own Qt installation.

See this:

using Qml.Net;
using Qml.Net.Runtimes;

namespace QmlQuickOverview
{
    class QmlExample
    {
        static int Main(string[] args)
        {
            RuntimeManager.DiscoverOrDownloadSuitableQtRuntime();

            using (var app = new QGuiApplication(args))
            {
                using (var engine = new QQmlApplicationEngine())
                {
                    // Register our new type to be used in Qml
                    Qml.Net.Qml.RegisterType<QmlType>("test", 1, 1);
                    engine.Load("Main.qml");
                    return app.Exec();
                }
            }
        }
    }
}

Notice the RuntimeManager.DiscoverOrDownloadSuitableQtRuntime(); call. This will download and setup pre-compiled libs for you. You don't need to worry about C++.

<!-- gh-comment-id:569510886 --> @pauldotknopf commented on GitHub (Dec 29, 2019): > If I would create a beginning guide would you include it? I'm not sure what you mean exactly by this. There isn't any advanced setup. You don't need to compile any C++ stuff yourself, unless you are compiling your own Qt installation. See this: ```csharp using Qml.Net; using Qml.Net.Runtimes; namespace QmlQuickOverview { class QmlExample { static int Main(string[] args) { RuntimeManager.DiscoverOrDownloadSuitableQtRuntime(); using (var app = new QGuiApplication(args)) { using (var engine = new QQmlApplicationEngine()) { // Register our new type to be used in Qml Qml.Net.Qml.RegisterType<QmlType>("test", 1, 1); engine.Load("Main.qml"); return app.Exec(); } } } } } ``` Notice the ```RuntimeManager.DiscoverOrDownloadSuitableQtRuntime();``` call. This will download and setup pre-compiled libs for you. You don't need to worry about C++.
Author
Owner

@vslmc commented on GitHub (Dec 30, 2019):

It may not be advanced for you, but for some people it might be :)
I managed to get both IDEs to work with a remote repo (qml.net) now I need to figure out how to link and compile Qml, C++ and C# in one executable file. And where I find the generated object files (I would need to share because of license)
(I will create a document how to set up everthing up to working exe and a sample window with a button that calls c# code. I will post it here first, so you can decide if you want to include it on your website or not, If not I might upload on my own github. But I would love to know you had looked once over it to atleast verfy the sample code)

btw I got this error:
Error CS0619: QQmlApplicationEngine.RegisterType(string, int, int) is not up to date: Use Qml.RegisterType() instead
*edit oh I see using Qml.Net.Qml.RegisterType works

Which license does qml.net use from Qt? I want to use it with LGPLv3 is this still possible?

You don't need to compile any C++ stuff yourself, unless you are compiling your own Qt installation.

Infact I want to compile Qt myself, even if I have no experience with c++. So what should I do instead?

<!-- gh-comment-id:569765443 --> @vslmc commented on GitHub (Dec 30, 2019): It may not be advanced for you, but for some people it might be :) I managed to get both IDEs to work with a remote repo (qml.net) now I need to figure out how to link and compile Qml, C++ and C# in one executable file. And where I find the generated object files (I would need to share because of license) (I will create a document how to set up everthing up to working exe and a sample window with a button that calls c# code. I will post it here first, so you can decide if you want to include it on your website or not, If not I might upload on my own github. But I would love to know you had looked once over it to atleast verfy the sample code) btw I got this error: Error CS0619: QQmlApplicationEngine.RegisterType<T>(string, int, int) is not up to date: Use Qml.RegisterType<T>() instead *edit oh I see using Qml.Net.Qml.RegisterType works Which license does qml.net use from Qt? I want to use it with LGPLv3 is this still possible? > You don't need to compile any C++ stuff yourself, unless you are compiling your own Qt installation. Infact I want to compile Qt myself, even if I have no experience with c++. So what should I do instead?
Author
Owner

@pauldotknopf commented on GitHub (May 30, 2020):

Using LGPLv3 is possible.

I'm closing this issue as of now. We will look to add some more documentation in the future for non-cpp types to compile their own native bits.

<!-- gh-comment-id:636263921 --> @pauldotknopf commented on GitHub (May 30, 2020): Using LGPLv3 is possible. I'm closing this issue as of now. We will look to add some more documentation in the future for non-cpp types to compile their own native bits.
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#115
No description provided.