How to install Bacon2D on Qt 5.7 (MacOS 10.11.5) #133
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello,
I've been trying to install Bacon2D on Qt5.7 on my MacOS 10.11.5 machine, but it simply doesn't work.
I followed the README explanation, no error at all at the end. My QtCreator installation is on the /Users//Applications/QtCreator folder. So I defined that folder. I ended with two folders:
/Users/<myUser>/Applications/QtCreator/Examples/Qt-5.7/bacon2dand
/Users/<myUser>//Applications/QtCreator/imports/Bacon2DThen I start Qt and create a QtQuick2 project to see that the import Bacon2D doesn't return anything. When I try to run the example from the QtCreator folder directly on the terminal the message is the same:
qrc:/main.qml:3 module "Bacon2D" is not installedWhat am I doing wrong?
This is what I've done so far:
git clone https://github.com/Bacon2D/Bacon2D.gitcd Bacon2Dgit submodule update --initmkdir build && cd build$HOME/Applications/QtCreator/5.7/clang_64/bin/qmake QTPATH=$HOME/Applications/QtCreator/5.7/ ..makemake installThen I create a new projet and type:
import Bacon2D 1.0The final result is always:
qrc:/main.qml:3 module "Bacon2D" is not installedThe
makeandmake installcommand don't seem to give any error.What am I doing wrong?
For some reason, Bacon2D can't run in Debug mode. Have you tried running it in Release mode?
I'll try it, but I still have a question, should I install it on:
?
Running in Release mode I have the exact same problem.
If I select the:
QtCreator/orQtCreator/5.7/folder, the red line below theimport Bacon2D 1.0doesn't dissapear, but if I install it on the clang_64 folder then it dissapear:But the error still remains, even after cleaning and rebuilding the project (on Release).

I think that I've found something,
Once I moved the Bacon2D folder from
importstoqmlthe bacon2D module started working (well the skeleton doesn't work, but I don't have the message saying that it isn't installed).Is it possible that there is a bug on the installer script?
The skeleton example:
Gives me this error
qrc:/main.qml:28: ReferenceError: entity is not definedEven a simple example:
Fails with the following error:
The skeleton example doesn't work because "entity" is not defined. Add "id: entity" under the Entity object.
The second example you posted doesn't return any error at all. It seems to have compiled with no issue.
If no window is displayed, try encapsulating the Game object in a Window object. Add "import QtQuick.Window 2.2" to your list of imports.
Here is a part of the bug report:
I have never used Bacon2D on Mac before, but I figured it would be similar to Windows.
The reason why I said you should encapsulate the Game object in a Window object is because Bacon2D was created when Qt's primary QML viewer was based on the QQuickView class. That class could take Items as its root. However, for newer versions of Qt, QQmlApplicationEngine has been the preferred to QQuickView. QQmlApplicationEngine requires a Window (or any class that inherits from it) as its root.
I'm not sure if it would solve your issue, but it's worth a try.
Before anything, I want to thank you for all your time and help you've provided me until now.
So I've made some testes and here are the results:
Show the window.
Gives the same error as posted before
Shows the window.
Shows the window with the red square moving
I simply don't understand why some cases work and the others return such a fatal error, that doesn't seem to make any sense to me.
But anyway, what is the right folder to put the library? There is no imports folder in my Qt5.7 installation, and all the QML plugins are in the qml folder. Shouldn't we make it look for the imports folder on the installation and only use that folder if it exists otherwise use the qml folder? The same for all the others, for now it seems to be working with clang but I'll have to do the work again in order to make it Working for iOS and then for Android.
There is a lot of issues on Mac/iOS that need to be solved:
The fatal error happens in case 2 because a Game object must have a current scene. If the current scene is null, the application would crash. I am not really sure why this happens, but to avoid it, make sure the Game object's currentScene property is never null or undefined.
In response to where to put the library, "make install" handles that for you. If you were able to run "make" and then "make install" then all files should have been placed in their proper directories.
Thank for the explanation on the first issue, when I solve all those issues I'll try to find out why this happens.
As for the library, the make install is based on the QTPATH selected early in the installation, but it goes into an imports folder which doesn't exists. All the libraries are on the qml section.
I've tried to install it following the Box2D QML library installation https://wiki.qt.io/Build_QML_Box2D_Library, which is based on the idea of compiling the library directly from QtCreator and then move it to the right folder (the same as the one done by terminal, but using QtCreator).
If I do as explaned for the Clang64 (desktop) version, it will work and then all I have to do is move the Bacon2D folder into the QML folder in order for it to work (perfect). But for the iphone I have two errors:
As for the MakeFile, maybe I could commit a change in order for it to look for a qml folder and add the library into that folder if it exists instead of the import one (since QtCreator doesn't look for it the same way on every platform)