I am using qChart.js in my QML project, and was able to access the libraries just fine by importing it into QML with
import jbQuick.Charts 1.0
and adding the resource path by hard-coding the file path
QQmlApplicationEngine engine;
engine.addImportPath("C:\\PathToProject\\qml\\");
However, I'd like to deploy my project and can't have a hard-coded path as this will change from user to user. I've attempted to add the files as specified in this question, so my qrc now has the following:
I've now modified my addImportPath statement to the following:
engine.addImportPath("qrc:///qml");
However, when running with QChart.qml
and QChart.js
included in the qrc file, I get the following error:
qmlcache_loader.obj:-1: error: LNK2001: unresolved external symbol "unsigned char const * const QmlCacheGeneratedCode::_qml_jbQuick_Charts_qml_jbQuick_Charts_QChart_js::qmlData" (?qmlData@_qml_jbQuick_Charts_qml_jbQuick_Charts_QChart_js@QmlCacheGeneratedCode@@3QBEB)
qmlcache_loader.obj:-1: error: LNK2001: unresolved external symbol "unsigned char const * const QmlCacheGeneratedCode::_qml_jbQuick_Charts_qml_jbQuick_Charts_QChart_qml::qmlData" (?qmlData@_qml_jbQuick_Charts_qml_jbQuick_Charts_QChart_qml@QmlCacheGeneratedCode@@3QBEB)
My understanding is that any file referenced in the qmldir
must also be added to the qrc file, which would be QChart.qml
and QChart.js
. I should also add that I am running this in Release mode. In debug mode, I simply get the module "jbQuick.Charts" is not installed
error. What am I doing wrong?