2

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:

enter image description here

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?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Kiwi
  • 235
  • 2
  • 7
  • I'm having some trouble squinting. I must be getting old. Do consider right-clicking on the errors, copying them, and pasting the errors onto the question inside quote blocks so that we can see them better. :-) – TrebledJ Feb 20 '19 at 15:48
  • @TrebuchetMS Oops, sorry about that! All fixed, also added a blurb at the bottom that that error only shows in release mode – Kiwi Feb 20 '19 at 15:59

0 Answers0