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

Static build fails to compile #32

Open
miken2c opened this issue Aug 30, 2024 · 7 comments
Open

Static build fails to compile #32

miken2c opened this issue Aug 30, 2024 · 7 comments

Comments

@miken2c
Copy link

miken2c commented Aug 30, 2024

Im getting this error when trying to compile qt static with particles:

1>particlesplugind.lib(particlesplugin_QtQuick2ParticlesPlugin.cpp.obj) : error LNK2019: unresolved external symbol "void __cdecl qml_register_types_QtQuick_Particles(void)" (?qml_register_types_QtQuick_Particles@@YAXXZ) referenced in function "public: __cdecl QtQuick2ParticlesPlugin::QtQuick2ParticlesPlugin(class QObject *)" (??0QtQuick2ParticlesPlugin@@QEAA@PEAVQObject@@@Z)

I'm on Windows compiling with VS2022, latest sources and extension.

@miken2c
Copy link
Author

miken2c commented Aug 30, 2024

I compiled the extension sources from this repo and now it compiled, however when i start my application:

module "QtQuick" plugin "qtquick2plugin" not found 
     import QtQuick 2.5 
     ^
file::/qt-project.org/imports/QtQuick/qmldir: module "QtQuick" plugin "qtquick2plugin" not found

@miken2c
Copy link
Author

miken2c commented Aug 30, 2024

I found that this is an open issue with a fix, i recompiled the extension with the modifications from:

https://codereview.qt-project.org/c/qt-labs/vstools/+/581695/3

Its not compiling anymore:

1>Build FAILED.
1>
1>C:\Users\Mike\AppData\Local\QtMsBuild\qt_vars.targets(39,5): error MSB4057: The target "QtQmlStaticGenerateImportFile" does not exist in the project.
1>    0 Warning(s)
1>    1 Error(s)

The fix isnt finished?

@miken2c
Copy link
Author

miken2c commented Sep 3, 2024

After uninstalling the extension i had the one on VS marketplace, i also had to delete the folder:
C:\Users\Mike\AppData\Local\QtMsBuild or it wouldnt update to the newer one (the one compiled with the sources from here).

But now i'm getting a different error:

AppData\Local\QtMsBuild\qml\qtqml_static.targets(349,5): error MSB4044: The "ReadLinesFromFile" task was not given a value for the required parameter "File". 

The error disappear if i add at least one .qml file to the .qrc, and the project compiles, however, i continue getting the same error:

module "QtQuick" version 2.5 cannot be imported because:
module "QtQml" plugin "qmlmetaplugin" not found 
     import QtQuick 2.5 
     ^

I also tried with a fresh new project.

I have C++20 set on the project properties but after installing this new source it looks like the project is no longer using C++20, is this a know issue?

I also start getting issues related to the precompile header, i have the path as:

image

And im getting compile errors on all moc files:

moc_....cpp(9,10): error C1083: Cannot open include file: 'source/stdafx.h': No such file or directory

This error only happens with this version.

@acdemiralp

@miken2c
Copy link
Author

miken2c commented Sep 10, 2024

@acdemiralp please update us with any info about this issue, its been weeks since i post this and i have been unable to properly compile my project

@acdemiralp
Copy link
Contributor

acdemiralp commented Oct 9, 2024

Hello, a fix which also covers the latter problems you experienced has already been merged and will be released soon. You can switch to the development version or copy the change at https://codereview.qt-project.org/c/qt-labs/vstools/+/581695 until then.

@kaheimri
Copy link
Collaborator

We have uploaded a new development release to qt-vsaddin-msvc2022-x64-3.3.0-rev.46.vsix that should fix your issue.
If you have any additional questions or need further assistance, please feel free to reach out.

@samkearney
Copy link

Hi, I am still encountering one of the later issues mentioned, involving a message like:

[...]\AppData\Local\QtMsBuild\qt_vars.targets(39,5): error MSB4057: The target "QtQmlStaticGenerateImportFile" does not exist in the project.

With a Qt project in Visual Studio 2019. The extension version is 3.3.1 and I see in the release notes that this issue QTVSADDINBUG-1173 was supposed to be fixed in 3.3.0.

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

No branches or pull requests

4 participants