1

I have an Qt Quick application:

/home/xx/projects/build-{project name}-Desktop_Qt_5_8_0_GCC_64bit
    |----app     (binary)
    |----imports (folder)
    |       |----org (folder)
    |             |----my (folder)
    |                   |----qt (folder)
    |                         |----libMyQuick.so
    |                         |----qmldir

I add follow paths into both plugin path and import path by QQmlApplicationEngine::addPluginPath(...) and QQmlApplicationEngine::addImportPath(...)

QCoreApplication::applicationDirPath() + "/imports"
QCoreApplication::applicationDirPath() + "/imports/org/my/qt"
"/home/xx/projects/build-{project name}-Desktop_Qt_5_8_0_GCC_64bit/imports/org/my/qt"

when I run app, error appear:

./app: error while loading shared libraries: libMyQuick.so: cannot open shared object file: No such file or directory

It can be run in Qt Creator.

How can I fix that?

project: https://www.dropbox.com/s/ho22c2pdsi2kaiq/TestQtQuickPlugin.tar.bz2?dl=0

A.J
  • 338
  • 1
  • 4
  • 16
  • Can you edit the debug output of running the application with `QML_IMPORT_TRACE=1` into your question? What do you mean when you say "but failed"? Was there an error message from the function? – Mitch Feb 24 '17 at 07:21
  • @Mitch I exported QML_IMPORT_TRACE as 1 in terminal, but no trace log print out – A.J Feb 24 '17 at 07:33
  • it might only show up in a debug build. Can you edit in the path you passed to addPluginPath? – Mitch Feb 24 '17 at 07:38
  • @Mitch I had append both relative path and absolute path – A.J Feb 24 '17 at 07:41
  • Can you provide the path you used. This is information we need to verify the problem; we can't just trust that the path is correct, because otherwise you probably wouldn't be asking about this. :) – Mitch Feb 24 '17 at 07:52
  • Hmm, the paths look correct. If I were you, I'd try to get my hands on a debug build so you can see what `QML_IMPORT_TRACE` has to say. – Mitch Feb 24 '17 at 08:14
  • Why don't you simply use `":/imports/org/my/qt"` as `addImportPath()` path ! – Vedanshu Feb 24 '17 at 15:13
  • @AnshKumar I had tried that, but it doesn't work – A.J Mar 07 '17 at 07:22
  • @A.J It's hard to tell this way. Perhaps you could send me your code so that I may have a took at it. – Vedanshu Mar 07 '17 at 07:37
  • @AnshKumar I have upload my project – A.J Mar 14 '17 at 06:55

0 Answers0