main.cpp から、QQmlEngineおよびコンストラクターを含むシンボルのホスト全体が未定義であるというリンカー エラーが発生します。QQmlComponent
#include <QCoreApplication>
#include <QtQml/QQmlEngine>
#include <QtQml/QQmlComponent>
#include <QtQml/QQmlContext>
int main(int argc, char* argv[]){
QCoreApplication app(argc, argv);
QQmlEngine eng;
QQmlComponent component(&eng, QUrl::fromLocalFile("app.qml"));
component.create();
}
を実行qmake -projectし、すべてを再構築しました。
他の質問とドキュメントを参照すると、インクルードは である必要があるようですQQmlEngineが、これは見つかりませんでしたQtQml/QQmlEngine。それらは同じものですか、それとも問題ですか?