Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not start #1

Open
atolstoy opened this issue Jan 6, 2023 · 9 comments
Open

Does not start #1

atolstoy opened this issue Jan 6, 2023 · 9 comments
Assignees

Comments

@atolstoy
Copy link

atolstoy commented Jan 6, 2023

When I try to run the compiled binary I get this:

bash-4.4$ ./Bacon-Ipsum 
QQmlApplicationEngine failed to load component
qrc:/main.qml: Library import requires a version
qrc:/main.qml: Library import requires a version
qrc:/main.qml: Library import requires a version
qrc:/main.qml: Library import requires a version
qrc:/main.qml: Library import requires a version

Any ideas?

@BaseMax
Copy link
Owner

BaseMax commented Jan 6, 2023

Hi there,

I wanted to let you know that I received your message about this issue.

I have tagged my colleague who we worked on this project together, and we will check it out to see what the issue might be. Thank you for letting us know about it.

Best regards,
M.

@BaseMax
Copy link
Owner

BaseMax commented Jan 6, 2023

It looks like there is an issue with loading a QML component in your application. The error message "Library import requires a version" suggests that there may be a problem with the version of the QML library being used in your application.

One possible cause of this error is if the version of the QML library specified in the import statement in your QML code does not match the version of the library that is installed on your system. You can check the version of the QML library that your application is using by checking the import statement in your QML code. You can then check the version of the QML library that is installed on your system to see if there is a mismatch.

If the versions of the QML library match, there could be other issues that are causing this error to occur. It might be helpful to check the QML logs or to run your application in a debugger to get more information about the cause of the error.

@TheCompez
Copy link
Collaborator

When I try to run the compiled binary I get this:

bash-4.4$ ./Bacon-Ipsum 
QQmlApplicationEngine failed to load component
qrc:/main.qml: Library import requires a version
qrc:/main.qml: Library import requires a version
qrc:/main.qml: Library import requires a version
qrc:/main.qml: Library import requires a version
qrc:/main.qml: Library import requires a version

Any ideas?

Hello,

It seems you are not using Qt version 6.
A QML file without a specific version number cannot be called in Qt5 and lower version, because this error occurred with the Qt6 version style system.

https://doc.qt.io/qt-6/qtqml-syntax-imports.html

In the Requirements section, we mentioned that at least Qt6 version is required.

@BaseMax
Copy link
Owner

BaseMax commented Jan 6, 2023

Hi @atolstoy,

I wanted to thank Kambiz for their clarification and explanation of the issue you were experiencing. Please let me know if the solution provided helped to fix the problem, and don't hesitate to reach out if you need any further assistance.

Best wishes,
M

@atolstoy
Copy link
Author

atolstoy commented Jan 6, 2023

When I try to run the compiled binary I get this:

bash-4.4$ ./Bacon-Ipsum 
QQmlApplicationEngine failed to load component
qrc:/main.qml: Library import requires a version
qrc:/main.qml: Library import requires a version
qrc:/main.qml: Library import requires a version
qrc:/main.qml: Library import requires a version
qrc:/main.qml: Library import requires a version

Any ideas?

Hello,

It seems you are not using Qt version 6. A QML file without a specific version number cannot be called in Qt5 and lower version, because this error occurred with the Qt6 version style system.

https://doc.qt.io/qt-6/qtqml-syntax-imports.html

In the Requirements section, we mentioned that at least Qt6 version is required.

Okay, let's make it clear: I just followed the installation steps provided in the readme.md. Namely, they are:

mkdir build
cd build
cmake ..
make
./Bacon-Ipsum

The program does seem to compile without errors. BTW, in my system I have both Qt5 and Qt6 development packages installed:

bash-4.4$ rpm -qa qt6-core-devel
qt6-core-devel-6.2.2-150400.2.8.x86_64
bash-4.4$ rpm -qa libQt5Core-devel
libQt5Core-devel-5.15.2+kde294-150400.6.3.1.x86_64

and so I assume that your application can properly get built against Qt6. It seem like it fails to do so:

bash-4.4$ ldd ./Bacon-Ipsum | grep Qt
        libQt5Quick.so.5 => /usr/lib64/libQt5Quick.so.5 (0x00007fc6aa200000)
        libQt5QmlModels.so.5 => /usr/lib64/libQt5QmlModels.so.5 (0x00007fc6a9e00000)
        libQt5Qml.so.5 => /usr/lib64/libQt5Qml.so.5 (0x00007fc6a9600000)
        libQt5Network.so.5 => /usr/lib64/libQt5Network.so.5 (0x00007fc6a9200000)
        libQt5Gui.so.5 => /usr/lib64/libQt5Gui.so.5 (0x00007fc6a8800000)
        libQt5Core.so.5 => /usr/lib64/libQt5Core.so.5 (0x00007fc6a8000000)
bash-4.4$ 

So, the question is, how to tell cmake to compile Bacon-Ipsum explicitly against Qt6?

@atolstoy
Copy link
Author

atolstoy commented Jan 7, 2023

Hi @atolstoy,

I wanted to thank Kambiz for their clarification and explanation of the issue you were experiencing. Please let me know if the solution provided helped to fix the problem, and don't hesitate to reach out if you need any further assistance.

Best wishes, M

Hello,
Please see my yesterday's comment with more details.
Cheers!

@TheCompez
Copy link
Collaborator

When I try to run the compiled binary I get this:

bash-4.4$ ./Bacon-Ipsum 
QQmlApplicationEngine failed to load component
qrc:/main.qml: Library import requires a version
qrc:/main.qml: Library import requires a version
qrc:/main.qml: Library import requires a version
qrc:/main.qml: Library import requires a version
qrc:/main.qml: Library import requires a version

Any ideas?

Hello,
It seems you are not using Qt version 6. A QML file without a specific version number cannot be called in Qt5 and lower version, because this error occurred with the Qt6 version style system.
https://doc.qt.io/qt-6/qtqml-syntax-imports.html
In the Requirements section, we mentioned that at least Qt6 version is required.

Okay, let's make it clear: I just followed the installation steps provided in the readme.md. Namely, they are:

mkdir build
cd build
cmake ..
make
./Bacon-Ipsum

The program does seem to compile without errors. BTW, in my system I have both Qt5 and Qt6 development packages installed:

bash-4.4$ rpm -qa qt6-core-devel
qt6-core-devel-6.2.2-150400.2.8.x86_64
bash-4.4$ rpm -qa libQt5Core-devel
libQt5Core-devel-5.15.2+kde294-150400.6.3.1.x86_64

and so I assume that your application can properly get built against Qt6. It seem like it fails to do so:

bash-4.4$ ldd ./Bacon-Ipsum | grep Qt
        libQt5Quick.so.5 => /usr/lib64/libQt5Quick.so.5 (0x00007fc6aa200000)
        libQt5QmlModels.so.5 => /usr/lib64/libQt5QmlModels.so.5 (0x00007fc6a9e00000)
        libQt5Qml.so.5 => /usr/lib64/libQt5Qml.so.5 (0x00007fc6a9600000)
        libQt5Network.so.5 => /usr/lib64/libQt5Network.so.5 (0x00007fc6a9200000)
        libQt5Gui.so.5 => /usr/lib64/libQt5Gui.so.5 (0x00007fc6a8800000)
        libQt5Core.so.5 => /usr/lib64/libQt5Core.so.5 (0x00007fc6a8000000)
bash-4.4$ 

So, the question is, how to tell cmake to compile Bacon-Ipsum explicitly against Qt6?

Well, you need to set variable CMAKE_PREFIX_PATH or QT_DIR and QT_SELECT=qt6 environment variable.

As a developer, it is better run the program through the QtCreator environment.
Or for deployment, you need to make it based this document:
https://doc.qt.io/qt-6/linux-deployment.html

@atolstoy
Copy link
Author

atolstoy commented Jan 7, 2023

Well, you need to set variable CMAKE_PREFIX_PATH or QT_DIR and QT_SELECT=qt6 environment variable.

I got it working by passing the following option:
cmake -DQT_DIR=/usr/lib64/cmake/Qt6 ..
However, the program still would not run for me since it requires the "Qt5Compat.GraphicalEffects" module, which is apparently not there in Qt 6.2. I advise to specify the exact required version of Qt 6.x in your readme.

But thanks for the assistance anyway))

@TheCompez
Copy link
Collaborator

TheCompez commented Jan 8, 2023

Thank you for your reports.
It seems that this module must be explicitly declared in versions lower than 6.4.

I made some changes to the project cmake settings and I hope it solves your problem about Qt5Compat.GraphicalEffects module.

289c6c9

Please get changes from repo and try again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants