Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Help setting up Marble to work with Qt

    General and Desktop
    marble
    2
    8
    3126
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ?
      A Former User last edited by A Former User

      I am trying to set up Marble to work with Qt 5.5 on OSX. I'm not very experienced with the details of building, linking and such and I think that is causing the problem I am having.

      Question: Did I screw up the 'marble` install and if so, can someone outline the steps to clean and install correctly.

      Qt 5.5 is installed in my user directory (using Qt's network installer) on a system running OSX 10.9.5. It works fine. I followed the instructions on the Marble site to clone, build and install from source with (I believe) the appropriate Qt flags. That seemed to go without issue. When I try to build the simple test app listed here, the #include <marble/MarbleWidget.h> line gives a "file not found" error.

      After the install I've ended up with the following:

      A "marble" directory in my root user folder

      enter image description here

      In my /usr/loca/ directory there is a "Marble.app" file along with various other marble related files in the bin and include directories. However the Marble.app gives the error below on launch,, my "include" doesn't work as noted, and the "libMarbleWidgetPlugin.so" plugin isn't recognized when it's dropped into the plugin directory.

      Dyld Error Message: Library not loaded:
      @rpath/QtCore.framework/Versions/5/QtCore Referenced from:
      /usr/local/Marble.app/Contents/MacOS/marble-qt
      Reason: image not found
      Binary Images:
      0x7fff6a1f9000 - 0x7fff6a22c817 dyld (239.4) <7AD43B9B-5CEA-3C7E-9836-A06909F9CA56> /usr/lib/dyld

      enter image description here

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        Did you call macdeployqt on Marble.app ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        ? 1 Reply Last reply Reply Quote 0
        • ?
          A Former User @SGaist last edited by

          @SGaist

          Did you call macdeployqt on Marble.app ?

          The "Marble.app" is built by cmake – so, no I just used the cmd in the instructions I linked to.

          I am actually more concerned about just being able to use the marbleWidget in my own projects – and since my #include statement fails, I must not have set things up correctly.

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            Sorry, I misunderstood your problem.

            First thing: did you call make install ? If so you should have everything under the /usr/local/ folder

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            ? 1 Reply Last reply Reply Quote 0
            • ?
              A Former User @SGaist last edited by

              @SGaist

              Yes I followed the instructions (below) and it all proceeded without error. It appears that lots of marble related files (headers, etc) are in various directories under /usr/local/. I don't know how to link to them.

              mkdir -p ~/marble/build
              cd ~/marble/build
              cmake -DCMAKE_BUILD_TYPE=Release -DWITH_KF5=FALSE -DCMAKE_INSTALL_PREFIX=/usr ~/marble/sources
              make
              sudo make install
              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by SGaist

                You can either use Qt Creator's Add Library feature or write it by hand in your .pro file.

                INCLUDEPATH += /usr/local/include
                LIBS += \
                    -L/usr/local/lib \
                    -lmarble
                

                I don't know the exact name of the library but it's probable something like that

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                ? 1 Reply Last reply Reply Quote 0
                • ?
                  A Former User @SGaist last edited by A Former User

                  @SGaist

                  Thanks. I used the "add Library" function and ended up with the following additions to the .pro file. I had to past in the link to the lib since the dialog doesn't allow browsing of "usr/local/". Also, although I tried to link to the lib alias ("libmarblewidget-qt5.dylib"), the actual lib name is used.

                  macx: LIBS += -L$$PWD/../../../../../usr/local/lib/ -lmarblewidget-qt5.0.21.80
                  
                  INCLUDEPATH += $$PWD/../../../../../usr/local/include
                  DEPENDPATH += $$PWD/../../../../../usr/local/include
                  

                  But it worked!

                  I don't understand what this "$$PWD/../../../../../" business is.

                  <rantish> I wish this install/build stuff wasn't so damned arcane. I've spent endless hours just trying to get things set up – really sucks the joy out of exploring this stuff. </rantish>

                  Update

                  So I cleaned out the "$$PWD" crap and the literal lib name and it works. Not sure what difference it makes – but there you go.

                  macx: LIBS += -L/usr/local/lib/ -lmarblewidget-qt5
                  
                  INCLUDEPATH +=/usr/local/include
                  DEPENDPATH +=/usr/local/include
                  
                  1 Reply Last reply Reply Quote 0
                  • SGaist
                    SGaist Lifetime Qt Champion last edited by

                    Good !

                    By the way, you have now the "Topic Tool" button to mark the thread as solved, no need to change the title anymore :)

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post