Closed wolfseifert closed 7 months ago
Right, i think that qrc
files are now automatically sorted for you since the move to QML modules etc, so you don't need manually include the cpp file any more. Looks like that has been missed in this part of the docs :-)
The cc.file("foo.cpp")
is still useful for including custom C++ classes however.
Right, i think that qrc files are now automatically sorted for you since the move to QML modules etc, so you don't need manually include the cpp file any more. Looks like that has been missed in this part of the docs :-)
That was implemented as part of implementing QML module support, but it's orthogonal. The cc.file("src/resources.cpp")
is obsolete now that cxx-qt-build builds the C++ file generated by qrc and links it with +whole-archive
.
I followed the instructions here:
and got a linkage error on Linux:
It turned out that removing
cc.file("file_with_include.cpp")
(and the file "file_with_include.cpp" itself) resolved the issue!!!It seems that the instruction above is not only obsolete, but also harmful (in the case of Linux). It makes no difference on Windows. Please remove it if I am right.
Here is a short reproducer which works as it is, but fails to link on Linux if you activate
cc.file("src/resources.cpp")
in build.rs:cxx-qt-issue.zip