×

Discussion Board

Results 1 to 10 of 10

Hybrid View

  1. #1
    Registered User
    Join Date
    Feb 2013
    Posts
    9

    Unhappy How to install Box2D plugin in Qt Creator

    Hello all, I dont know how to install Box2D plugin/module in Qt Creator.
    I know that it has already addressed here but I do not know to figure it out and long time I worry with it.
    Here is my procedure:

    I created new project called test.

    I Downloaded file Box2DDemo_v0_2.zip from http://projects.developer.nokia.com/qmlbox2ddemo I unpacked it an open directory qmlbox2ddemo\src and copy folder qml-box2d in test folder.

    In test.pro file I wrote:

    Code:
    include(qml-box2d/Box2D/Box2D.pri)
    include(qml-box2d/box2d-static.pri)
    In test.cpp file I wrote:
    Code:
    #include "box2dplugin.h"
    In main.qml and MainPage.qml I wrote:
    Code:
    import Box2D 1.0
    When I click on Run button it tells:
    module "Box2D" is not installed.
    Thanks for help.

  2. #2
    Registered User
    Join Date
    Apr 2012
    Location
    malaysia
    Posts
    260

    Re: How to install Box2D plugin in Qt Creator

    Do you have the box2d library in your qt sdk?

  3. #3
    Registered User
    Join Date
    Feb 2013
    Posts
    9

    Re: How to install Box2D plugin in Qt Creator

    Yes I downloaded master file from this site http://gitorious.org/qml-box2d/qml-box2d/trees/master and I unpacked it and gave it in directory \Symbian\SDKs\Symbian3Qt474\epoc32\data\z\resource\qt\imports.
    I created folder called Box2D and gave files qml-box2d-qml-box2d and pax_global_header inside.
    After that I opened project in \Symbian\SDKs\Symbian3Qt474\epoc32\data\z\resource\qt\imports\Box2D\qml-box2d-qml-box2d\box2d.pro.
    I clicked projects on the left panel, Symbian Device – Build and in build settings qt 4.7.4 for symbian anna (qt sdk) relase.

    I clicked on the Build button and I get these errors:
    http://imageshack.us/photo/my-images/341/error1a.png
    http://imageshack.us/photo/my-images/266/error2z.png

  4. #4
    Registered User
    Join Date
    Apr 2012
    Location
    malaysia
    Posts
    260

    Re: How to install Box2D plugin in Qt Creator

    I think you should put in "include" not "import" and you should not just copy and paste like that.Create a new folder and rename it like "qtbox2d" then put all the pri.file,and all the source and header files in the folder you created and don't create subfolder.Leave out the "pax_global_header.That files have nothing to do with box2d library.After that,edit all the code again like "#include qtbox2d/box2dplugin.h".After you type "qtbox2d" it should give you a selection of file you want to include.You should always type "qtbox2d" first.At least this method work for me.I hope it work for you too.

    Code:
    #include qtbox2d/box2dplugin.h

  5. #5
    Registered User
    Join Date
    Feb 2013
    Posts
    9

    Re: How to install Box2D plugin in Qt Creator

    Which include folder do you mean? Because there are approximately 10 folder with name include in symbian folder.
    I mean that you are wrong becouse when I write
    #include "qtbox2d/box2dplugin.h"
    that means that qtbox2d is located in project folder in qmlapplicationwiever folder or no?
    Is neaded to build project from master file first or no?
    Is neaded to use import Box2D 1.0 or no?

    Because there is not word about include there is only about import.
    http://qt-project.org/wiki/Build-QML-Box2D-Library
    Last edited by Megaplayer; 2013-02-18 at 12:13.

  6. #6
    Registered User
    Join Date
    Apr 2012
    Location
    malaysia
    Posts
    260

    Re: How to install Box2D plugin in Qt Creator

    The path is QtSDK>Symbian>SDks>Symbian3Qt474>include.This where you should put the library.In the code,include is the path,qtbox2d is the folder you create in the path and the box2dplugin.h is the header and source files you put in that folder you created.This a way i learn from trial and error so not a professional way but it work for me.I think the page you link is the way to build the box2d with pro. files.I just directly put the library in the path but not sure if there is any different

  7. #7
    Registered User
    Join Date
    Feb 2013
    Posts
    9

    Re: How to install Box2D plugin in Qt Creator

    I tried it but it don´t works too. I mean that box2d plugin needed not be placed in imports or include folder.
    Because when I try to run Box2D demo http://projects.developer.nokia.com/qmlbox2ddemo I do not need to have installed master file from gitorious site because plugin is included in demo (in folder where are .pro and .cpp files of demo).
    I will try to learn how to use plugin from the demo and try to apply plugin in my project.
    When I learn how to use plugin so I write here. Or if anyone knew exactly how to use the plugin so please write it here.
    Thank you very much babylongreece for your help and for your time.

  8. #8
    Registered User
    Join Date
    Aug 2011
    Posts
    39

    Lightbulb Re: How to install Box2D plugin in Qt Creator

    You can a system wide install, with:
    qmake
    make
    sudo make install

    Or, if you would like to build the plugin statically into your project, then you put a copy under your own project (say, /qml-box2d), add the necessary includes and registration calls to your sources and build files.

    Add somewhere in your .pro file:
    Code:
    include(qml-box2d/box2d-static.pri)
    And in your main.cpp includes, add:

    Code:
    #include <box2dplugin.h>
    And before using the qmldeclarativeview, register box2d plugin
    Code:
    Box2DPlugin box2dplugin;
    box2dplugin.registerTypes("Box2D");

  9. #9
    Registered User
    Join Date
    Aug 2011
    Posts
    39

    Re: How to install Box2D plugin in Qt Creator

    You might like to checkout my forked version of the QML Box2D bindings (as the one on gitorious has concentrated on Qt 5), it has more box2d features implemented. https://github.com/oniongarlic/qml-box2d

  10. #10
    Registered User
    Join Date
    Feb 2013
    Posts
    9

    Re: How to install Box2D plugin in Qt Creator

    Thanks it works, certainly it will help others as well.

Similar Threads

  1. Box2d Plugin Working for desktop but not in the Symbian
    By engrnaveed in forum [Archived] Qt Quick
    Replies: 3
    Last Post: 2012-06-07, 09:33
  2. Box2d QML Plugin
    By engrnaveed in forum [Archived] Qt Quick
    Replies: 2
    Last Post: 2012-04-27, 09:13
  3. How get install s60 sdk on QT creator properly?
    By MrRubberBand in forum [Archived] Qt SDKs and Tools
    Replies: 4
    Last Post: 2011-05-01, 21:31
  4. Install a new wizard in Qt-creator
    By CostaCampos in forum [Archived] Qt SDKs and Tools
    Replies: 1
    Last Post: 2010-09-20, 18:16
  5. Replies: 7
    Last Post: 2010-07-14, 14:58

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •