Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module "Box2D" is not installed #233

Open
gjherbiet opened this issue Jul 6, 2018 · 3 comments
Open

module "Box2D" is not installed #233

gjherbiet opened this issue Jul 6, 2018 · 3 comments

Comments

@gjherbiet
Copy link

Hello,

Roughly following https://mail.kde.org/pipermail/gcompris-devel/2018-January/005359.html and https://www.ynonperek.com/2017/09/18/building-gcompris-qt-on-macos/ I now have a working version of GCompris with translations.

However some activities don't work and yield the following error message:

qrc:/gcompris/src/activities/land_safe/LandSafe.qml:23:1: module "Box2D" is not installed

I tried to specify how to build Box2D using:

$ cmake -DQML_BOX2D_MODULE=submodule ..
$ make all
[...]
[ 11%] Built target BuildTranslations
[ 11%] Creating directories for 'qml_box2d'
[ 11%] No download step for 'qml_box2d'
[ 11%] No patch step for 'qml_box2d'
[ 11%] No update step for 'qml_box2d'
[ 13%] Performing configure step for 'qml_box2d'
[ 13%] Performing build step for 'qml_box2d'
[ 13%] Performing install step for 'qml_box2d'
[ 14%] Completed 'qml_box2d'
[ 14%] Built target qml_box2d
[...]

After compilation, there is a libBox2D.dylib in qml_box2d-prefix/src/qml_box2d-build under my build dir.

What step is missing to get this library in a place where it is picked up by GCompris at run-time?

@petitlapin
Copy link
Member

Hi,

do you also have it in $buildFolder/lib/qml/Box2D.2.0/{libBox2D.dylib, qmldir}?

It should be using this one.

Can you try exporting QT_DEBUG_PLUGINS (export QT_DEBUG_PLUGINS=1) and check if it finds box2d (I have a specific log for box2d when running land_safe activity).

Johnny

@gjherbiet
Copy link
Author

Yes, I tried the following:

$ export QT_DEBUG_PLUGINS=1
$ cd $buildFolder
$ cp lib/qml/Box2D.2.0/libBox2D.dylib bin/gcompris-qt.app/Contents/PlugIns/platforms
$ bin/gcompris-qt.app/Contents/MacOS/gcompris-qt
[..]
QFactoryLoader::QFactoryLoader() checking directory path "/Users/gjherbiet/Development/GCompris-qt/build/bin/gcompris-qt.app/Contents/Plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/Users/gjherbiet/Development/GCompris-qt/build/bin/gcompris-qt.app/Contents/Plugins/platforms/libBox2D.dylib"
Found metadata in lib /Users/gjherbiet/Development/GCompris-qt/build/bin/gcompris-qt.app/Contents/PlugIns/platforms/libBox2D.dylib, metadata=
{
    "IID": "org.qt-project.Qt.QQmlExtensionInterface",
    "MetaData": {
    },
    "className": "Box2DPlugin",
    "debug": false,
    "version": 330497
}


Got keys from plugin meta data ()
[...]
qrc:/gcompris/src/activities/land_safe/LandSafe.qml:23:1: module "Box2D" is not installed

So it seems the library is found but still not loaded.

@petitlapin
Copy link
Member

petitlapin commented Jul 6, 2018

Yes, on my side, I have the following log: loaded library "/home/jazeix/Desktop/travail/gcompris/build/lib/qml/Box2D.2.0/libBox2D.so" after.

There is also the env var QML_IMPORT_TRACE that should display info:
QQmlImports(qrc:/gcompris/src/activities/land_safe/LandSafe.qml)::addLibraryImport: "Box2D" 2.0 as ""
QQmlImports(qrc:/gcompris/src/activities/land_safe/LandSafe.qml)::importExtension: loaded "/home/jazeix/Desktop/travail/gcompris/build/lib/qml/Box2D.2.0/qmldir"
QQmlImportDatabase::registerPluginTypes: "Box2D" from "/home/jazeix/Desktop/travail/gcompris/build/lib/qml/Box2D.2.0"

Have you also copied the qmldir file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants