Results 1 to 15 of 15

Thread: How to get QWT 6.0.0 working on QT SDK v1.1.2 (based on QT v4.7.3) for Mac OS 10.6

  1. #1
    Join Date
    Jun 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to get QWT 6.0.0 working on QT SDK v1.1.2 (based on QT v4.7.3) for Mac OS 10.

    Hi,

    I managed to get QWT 6.0.0 working on QT SDK v1.1.2 (based on QT v4.7.3) for Mac OS 10.6 so I though I'd write a quick guide on how to do it. I hope it helps others who are struggling:

    1. Install the QT SDK:
      1. Install Qt_SDK_Mac64_offline_v1_1_2_en.dmg using default settings

    2. Edit the PATH variable:
      1. Open Terminal
      2. sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/paths
      3. Add this path to end of file on a new line:
      4. ~/QtSDK/Desktop/Qt/473/gcc/bin
      5. Save

    3. Install QWT:
      1. Extract qwt-6.0.0 to a folder without spaces in its path
      2. Open qwtconfig.pri in a TextEdit
      3. Delete the # in front of the following line:
      4. # QWT_CONFIG += QwtExamples
      5. Open Terminal
      6. cd to the QWT folder
      7. qmake -spec macx-g++
      8. make
      9. make install

    4. Make QWT widgets appear in Designer:
      1. Open /usr/local/qwt-6.0.0/plugins/designer
      2. Copy libqwt_designer_plugin.dylib
      3. Open ~/QtSDK/Desktop/Qt/473/gcc/plugins/designer

    5. Make QWT widgets appear in Creator:
      1. Open /usr/local/qwt-6.0.0/plugins/designer
      2. Copy libqwt_designer_plugin.dylib
      3. Open ~/QtSDK
      4. Right click Qt Creator.app
      5. Select “Show package contents”
      6. Go to Contents/Plugins/Designer
      7. Paste libqwt_designer_plugin.dylib there
      8. Open /usr/local/qwt-6.0.0/lib
      9. Copy all (should be two folders: qwt.framework and qwtmathml.framework)
      10. Open ~/QtSDK
      11. Right click Qt Creator.app
      12. Select “Show package contents”
      13. Go to Contents/Frameworks
      14. Paste
      15. Fix QWT's QT designer library references:
        1. Run the following in Terminal to check the library references:
          Qt Code:
          1. otool -L ~/QtSDK/Qt\ Creator.app/Contents/Plugins/designer/libqwt_designer_plugin.dylib
          To copy to clipboard, switch view to plain text mode 
          You'll get something like the following:
          Qt Code:
          1. /Users/Philip/QtSDK/Qt Creator.app/Contents/Plugins/designer/libqwt_designer_plugin.dylib:
          2. libqwt_designer_plugin.dylib (compatibility version 0.0.0, current version 0.0.0)
          3. qwt.framework/Versions/6/qwt (compatibility version 6.0.0, current version 6.0.0)
          4. /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtScript.framework/Versions/Current/QtScript (compatibility version 4.7.0, current version 4.7.3)
          5. /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtXml.framework/Versions/Current/QtXml (compatibility version 4.7.0, current version 4.7.3)
          6. /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtGui.framework/Versions/Current/QtGui (compatibility version 4.7.0, current version 4.7.3)
          7. /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtCore.framework/Versions/Current/QtCore (compatibility version 4.7.0, current version 4.7.3)
          8. /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtDesigner.framework/Versions/Current/QtDesigner (compatibility version 4.7.0, current version 4.7.3)
          9. /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
          10. /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 832.0.0)
          11. /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.10)
          To copy to clipboard, switch view to plain text mode 
        2. Run these commands to fix the library references (change all references to "/Users/Philip/" to the correct path for your system):
          Qt Code:
          1. cd ~/QtSDK/Qt\ Creator.app/Contents/Plugins/designer;
          2. sudo install_name_tool -change /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtCore.framework/Versions/Current/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore libqwt_designer_plugin.dylib;
          3. sudo install_name_tool -change /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtGui.framework/Versions/Current/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui libqwt_designer_plugin.dylib;
          4. sudo install_name_tool -change /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtXml.framework/Versions/Current/QtXml @executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml libqwt_designer_plugin.dylib;
          5. sudo install_name_tool -change /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtScript.framework/Versions/Current/QtScript @executable_path/../Frameworks/QtScript.framework/Versions/4/QtScript libqwt_designer_plugin.dylib;
          6. sudo install_name_tool -change /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtDesigner.framework/Versions/Current/QtDesigner @executable_path/../Frameworks/QtDesigner.framework/Versions/4/QtDesigner libqwt_designer_plugin.dylib;
          7. sudo install_name_tool -change qwt.framework/Versions/6/qwt @executable_path/../Frameworks/qwt.framework/Versions/6/qwt libqwt_designer_plugin.dylib;
          To copy to clipboard, switch view to plain text mode 
        3. Run the following in Terminal to check that the library references are now correct:
          Qt Code:
          1. otool -L ~/QtSDK/Qt\ Creator.app/Contents/Plugins/designer/libqwt_designer_plugin.dylib
          To copy to clipboard, switch view to plain text mode 
          You should get the following:
          Qt Code:
          1. /Users/Philip/QtSDK/Qt Creator.app/Contents/Plugins/designer/libqwt_designer_plugin.dylib:
          2. libqwt_designer_plugin.dylib (compatibility version 0.0.0, current version 0.0.0)
          3. @executable_path/../Frameworks/qwt.framework/Versions/6/qwt (compatibility version 6.0.0, current version 6.0.0)
          4. @executable_path/../Frameworks/QtScript.framework/Versions/4/QtScript (compatibility version 4.7.0, current version 4.7.3)
          5. @executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml (compatibility version 4.7.0, current version 4.7.3)
          6. @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, current version 4.7.3)
          7. @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, current version 4.7.3)
          8. @executable_path/../Frameworks/QtDesigner.framework/Versions/4/QtDesigner (compatibility version 4.7.0, current version 4.7.3)
          9. /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
          10. /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 832.0.0)
          11. /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.10)
          To copy to clipboard, switch view to plain text mode 

      16. Fix QWT's library references:
        1. Run the following in Terminal to check the library references:
          Qt Code:
          1. otool -L ~/QtSDK/Qt\ Creator.app/Contents/Frameworks/qwt.framework/Versions/6/qwt
          To copy to clipboard, switch view to plain text mode 
          You'll get something like the following:
          Qt Code:
          1. /Users/Philip/QtSDK/Qt Creator.app/Contents/Frameworks/qwt.framework/Versions/6/qwt:
          2. qwt.framework/Versions/6/qwt (compatibility version 6.0.0, current version 6.0.0)
          3. /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtSvg.framework/Versions/Current/QtSvg (compatibility version 4.7.0, current version 4.7.3)
          4. /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtGui.framework/Versions/Current/QtGui (compatibility version 4.7.0, current version 4.7.3)
          5. /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtCore.framework/Versions/Current/QtCore (compatibility version 4.7.0, current version 4.7.3)
          6. /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
          7. /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 832.0.0)
          8. /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.10)
          To copy to clipboard, switch view to plain text mode 
        2. Run these commands to fix the library references (change all references to "/Users/Philip/" to the correct path for your system):
          Qt Code:
          1. cd ~/QtSDK/Qt\ Creator.app/Contents/Frameworks;
          2. sudo install_name_tool -change /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtCore.framework/Versions/Current/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore qwt.framework/Versions/6/qwt;
          3. sudo install_name_tool -change /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtGui.framework/Versions/Current/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui qwt.framework/Versions/6/qwt;
          4. sudo install_name_tool -change /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtSvg.framework/Versions/Current/QtSvg @executable_path/../Frameworks/QtSvg.framework/Versions/4/QtSvg qwt.framework/Versions/6/qwt;
          To copy to clipboard, switch view to plain text mode 
        3. Run the following in Terminal to check that the library references are now correct:
          Qt Code:
          1. otool -L ~/QtSDK/Qt\ Creator.app/Contents/Frameworks/qwt.framework/Versions/6/qwt
          To copy to clipboard, switch view to plain text mode 
          You should get the following:
          Qt Code:
          1. /Users/Philip/QtSDK/Qt Creator.app/Contents/Frameworks/qwt.framework/Versions/6/qwt:
          2. qwt.framework/Versions/6/qwt (compatibility version 6.0.0, current version 6.0.0)
          3. @executable_path/../Frameworks/QtSvg.framework/Versions/4/QtSvg (compatibility version 4.7.0, current version 4.7.3)
          4. @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, current version 4.7.3)
          5. @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, current version 4.7.3)
          6. /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
          7. /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 832.0.0)
          8. /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.10)
          To copy to clipboard, switch view to plain text mode 

      17. Fix QWTMATHML's library references:
        (see next post)
    Last edited by Phil64; 25th June 2011 at 23:10.

  2. #2
    Join Date
    Jun 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to get QWT 6.0.0 working on QT SDK v1.1.2 (based on QT v4.7.3) for Mac OS 10.


    17. Fix QWTMATHML's library references:
    1. Run the following in Terminal to check the library references:
      Qt Code:
      1. otool -L ~/QtSDK/Qt\ Creator.app/Contents/Frameworks/qwtmathml.framework/Versions/6/qwtmathml
      To copy to clipboard, switch view to plain text mode 
      You'll get something like the following:
      Qt Code:
      1. /Users/Philip/QtSDK/Qt Creator.app/Contents/Frameworks/qwtmathml.framework/Versions/6/qwtmathml:
      2. qwtmathml.framework/Versions/6/qwtmathml (compatibility version 6.0.0, current version 6.0.0)
      3. qwt.framework/Versions/6/qwt (compatibility version 6.0.0, current version 6.0.0)
      4. /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtXml.framework/Versions/Current/QtXml (compatibility version 4.7.0, current version 4.7.3)
      5. /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtGui.framework/Versions/Current/QtGui (compatibility version 4.7.0, current version 4.7.3)
      6. /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtCore.framework/Versions/Current/QtCore (compatibility version 4.7.0, current version 4.7.3)
      7. /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
      8. /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 832.0.0)
      9. /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.10)
      To copy to clipboard, switch view to plain text mode 


    2. Run these commands to fix the library references (change all references to "/Users/Philip/" to the correct path for your system):
      Qt Code:
      1. cd ~/QtSDK/Qt\ Creator.app/Contents/Frameworks;
      2. sudo install_name_tool -change /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtXml.framework/Versions/Current/QtXml @executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml qwtmathml.framework/Versions/6/qwtmathml;
      3. sudo install_name_tool -change /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtGui.framework/Versions/Current/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui qwtmathml.framework/Versions/6/qwtmathml;
      4. sudo install_name_tool -change /Users/Philip/QtSDK/Desktop/Qt/473/gcc/lib/QtCore.framework/Versions/Current/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore qwtmathml.framework/Versions/6/qwtmathml;
      5. sudo install_name_tool -change qwt.framework/Versions/6/qwt @executable_path/../Frameworks/qwt.framework/Versions/6/qwt qwtmathml.framework/Versions/6/qwtmathml;
      To copy to clipboard, switch view to plain text mode 
    3. Run the following in Terminal to check that the library references are now correct:
      Qt Code:
      1. otool -L ~/QtSDK/Qt\ Creator.app/Contents/Frameworks/qwtmathml.framework/Versions/6/qwtmathml
      To copy to clipboard, switch view to plain text mode 
      You should get the following:
      Qt Code:
      1. /Users/Philip/QtSDK/Qt Creator.app/Contents/Frameworks/qwtmathml.framework/Versions/6/qwtmathml:
      2. qwtmathml.framework/Versions/6/qwtmathml (compatibility version 6.0.0, current version 6.0.0)
      3. @executable_path/../Frameworks/qwt.framework/Versions/6/qwt (compatibility version 6.0.0, current version 6.0.0)
      4. @executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml (compatibility version 4.7.0, current version 4.7.3)
      5. @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, current version 4.7.3)
      6. @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, current version 4.7.3)
      7. /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
      8. /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 832.0.0)
      9. /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.10)
      To copy to clipboard, switch view to plain text mode 

      Source for info about changing library references: http://doc.qt.nokia.com/qtcreator-2....g-plugins.html


    I'm a QT+QWT beginner so there may be errors in this guide - this setup seems to work for me though. If there are any errors, please post a comment and I'll edit my original post. Also, feel free to post additions if you feel that something is missing.

  3. #3
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,294
    Thanked 877 Times in 825 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to get QWT 6.0.0 working on QT SDK v1.1.2 (based on QT v4.7.3) for Mac OS 10.

    Quote Originally Posted by Phil64 View Post
    If there are any errors, please post a comment and I'll edit my original post. Also, feel free to post additions if you feel that something is missing.
    I don't agree with your advices about copying libraries around, because it is one of the main sources of problems. Instead configure your environment to work with the Qwt installation as it is - like it is described in the INSTALL file.

    Uwe

  4. #4
    Join Date
    Jun 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to get QWT 6.0.0 working on QT SDK v1.1.2 (based on QT v4.7.3) for Mac OS 10.

    As suggested in INSTALL I set two environment variables in ~/.MacOSX/environment.plist:
    DYLB_LIBRARY_PATH I set to /usr/local/qwt-6.0.0/lib
    QT_PLUGIN_PATH I set to /usr/local/qwt-6.0.0/plugins/designer
    Unfortunately that didn't make the plugins appear in either Designer or Creator (the list of loaded plugins doesn't even indicate that the plugin failed to load). Should I have set the paths to something else? Should I have changed another setting too?

    Which problems will I experience with my current setup?
    Last edited by Phil64; 26th June 2011 at 18:58.

  5. #5

    Default Re: How to get QWT 6.0.0 working on QT SDK v1.1.2 (based on QT v4.7.3) for Mac OS 10.

    Hello Phil64. Long time reader, first post here.

    Thank you for the clear instructions - worked like a charm!

    The instructions supplied with the install file isn't very good (to say the least!) It seems that the author isn't very familiar with Mac OSX. Yours fixed all the problems. Keep up the good work!

  6. #6
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,294
    Thanked 877 Times in 825 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to get QWT 6.0.0 working on QT SDK v1.1.2 (based on QT v4.7.3) for Mac OS 10.

    Quote Originally Posted by Kaptein View Post
    Thank you for the clear instructions - worked like a charm!
    Unfortunately these type of cookbooks mean such a lot of work for me, because others follow them. That's why I decided to comment as soon as they appear: don't do it this way !

    A cookbook I could agree with might explain how to set up an environment to use a properly installed Qwt 6.x. I will always disagree with advices, that include steps copying Qwt files manually. Also note, that all steps about how to configure the Qwt features file ( = using Qwt in your application ) are missing.

    Of course the instructions in the INSTALL file could be better and I would be happy with comments about how to fix/improve/elaborate the text for the different platforms.

    Uwe

    @Phil: what about writing an INSTALL file ( that could be included into the Qwt package ) for the Mac showing the various options how to configure an environment to use Qwt on the Mac - maybe with listings of commands for a couple of reasonable configurations ?

  7. #7
    Join Date
    Jul 2011
    Posts
    4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to get QWT 6.0.0 working on QT SDK v1.1.2 (based on QT v4.7.3) for Mac OS 10.

    This is what I did to make qwt run in QT 4.7.3 Creator and Designer on Mac OS 10.6.8. I have my QtSDK installed in /Developer/QtSDK/. I noticed that the installer has put two different Qt Designer copies. I'm focusing here on the one found in QtSDK/Desktop/Qt/473/gcc/bin/Designer.app. The other copy in QtSDK/Designer.app may be ignored or treated as in step (4) below for Qt Creator.

    (1) Put qwt and qwtmathml in the "default" location:
    /Library/Frameworks/qwt.framework
    /Library/Frameworks/qwtmathml.framework

    (2) Put libqwt_designer_plugin.dylib somewhere. In my case I put it here:
    /usr/local/plugins/designer/libqwt_designer_plugin.dylib

    (3) To make Qt Designer use libqwt_designer_plugin.dylib:
    cd /Developer/QtSDK/Desktop/Qt/473/gcc/plugins/designer
    ln -s /usr/local/plugins/designer/libqwt_designer_plugin.dylib .

    (4) To make Qt Creator use libqwt_designer_plugin.dylib:
    cd /Developer/QtSDK/Qt\ Creator.app/Contents/PlugIns/designer
    ln -s /usr/local/plugins/designer/libqwt_designer_plugin.dylib .
    (Following needed to resolve the 2 conflicting distributions of Qt frameworks bundled with Qt 4.7.3.)
    cd ../..
    mv Frameworks Frameworks.orig
    ln -s ../../Desktop/Qt/473/gcc/lib Frameworks

    And, now qwt can be run in both Qt Creator and Qt Designer.

    Joofa

  8. #8
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,294
    Thanked 877 Times in 825 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to get QWT 6.0.0 working on QT SDK v1.1.2 (based on QT v4.7.3) for Mac OS 10.

    Even if it works for you: please don't post steps like these. There are so much work with support requests of people that are following these "copy files here and there", stories, what doesn't work in other environments.

    Again, this is what should be done:

    1) Edit qwtconfig.pri
    2) make + make install
    3) Configure your environment to use Qwt, like it has been installed

    Uwe

  9. #9
    Join Date
    Jul 2011
    Posts
    4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to get QWT 6.0.0 working on QT SDK v1.1.2 (based on QT v4.7.3) for Mac OS 10.

    Quote Originally Posted by Uwe View Post
    Even if it works for you: please don't post steps like these. There are so much work with support requests of people that are following these "copy files here and there", stories, what doesn't work in other environments.

    Again, this is what should be done:

    1) Edit qwtconfig.pri
    2) make + make install
    3) Configure your environment to use Qwt, like it has been installed

    Uwe
    Uwe,

    I believe that setup I described corresponds to your steps. My steps (1) and (2) are more and less what your step (2) (make+make install) would do. On a Linux system the make install would put 3rd party stuff in a "default" place, say, /usr/local. On a Mac system, the default for 3rd party frameworks is /Libraries/Frameworks, and for dylibs (same as .so on Linux or .dll on Windows) is /usr/local. The default compilation of qwt produces frameworks, though I think it can be changed to produce dylibs, if one wanted to. Having qwt frameworks in the default location would also avoid the otool commands that Phil has mentioned above. We are not making redundant copies of frameworks here. There is only one copy. However, it goes to the location Mac OS likes to have frameworks around. You can put it in other locations but then one has to setup additional things to make Mac OS find it.

    Furthermore, there is some discrepancy in the way Qt has bundled 4.7.3 on Mac OS. There are redundant copies of the frameworks for (QtCore, QtGui, etc.) at several different places. Using default compilation, qwt framework and qwt designer plugin get linked with different copies of Qt frameworks than Qt Creator. At runtime that cause confusion for the system regarding which one to load, and I have noticed that Qt Creator crashes because of this, if one wants to use the qwt designer plugin in Creator during UI design. When I followed the commands in my step 4 below the red it became OK and Qt Creator could use qwt designer plugin.

    At other times, redundancy of frameworks may make some qwt gui elements unresponsive - Bode example in qwt became unresponsive to left mouse button on the plot on my system. BTW, that happened due to some redundant copies of frameworks by macdeployqt tool that is bundled with Qt. If macdeploytool was not used then Bode was ok.

    Sincerely,

    Joofa
    Last edited by joofa; 30th July 2011 at 21:20.

  10. #10
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,294
    Thanked 877 Times in 825 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to get QWT 6.0.0 working on QT SDK v1.1.2 (based on QT v4.7.3) for Mac OS 10.

    Quote Originally Posted by joofa View Post
    I believe that setup I described corresponds to your steps. My steps (1) and (2) are more and less what your step (2) (make+make install) would do.
    Note, that qwtconfig.pri is part of the installation and included by the features file qwt.prf. So when writing "CONFIG += qwt" all settings of qwtconfig.pri are known, when compiling and linking application code. With your additional steps all paths in qwtconfig.pri are broken, users can't use the Qwt features file, or even worse try to use it and run into errors.

    Quote Originally Posted by joofa View Post
    You can put it in other locations but then one has to setup additional things to make Mac OS find it.
    This is nothing specific for the Mac. On Linux systems you could copy all libraries to /usr/lib ( or any other path, that is configured by default ) or add a path using ldconfig or LD_LIBRARY_PATH. On Windows it is the PATH variable, that has to be extended.

    F.e. most Linux distributions install their Qwt packages in default paths, what is completely o.k. because they take care of all packages on a system and how they play together. But in case of building and installing software manually there are good reasons not to do so.

    Quote Originally Posted by joofa View Post
    Furthermore, there is some discrepancy in the way Qt has bundled 4.7.3 on Mac OS. There are redundant copies of the frameworks for (QtCore, QtGui, etc.) at several different places.
    Hm, don't know about this particular package - but the Creator doesn't need to be built against the same Qt libraries. But I can't believe, that it's not obvious which libraries have to be used for building applications ( in the creator you can configure which Qt version you want to build your application with ).

    Quote Originally Posted by joofa View Post
    Using default compilation, qwt framework and qwt designer plugin get linked with different copies of Qt frameworks than Qt Creator.
    That is absolutely how it is supposed to be:

    The Qt libraries the Creator is linked to have nothing to do with the libraries your application is supposed to use. Creator and Qt are different products with different development cycles and installing a new version of the Creator should never have an impact on the version of Qt your application is built with. Looks like your problems are the result of your attempts to use the internal libraries used for the Creator instead of the Qt version you have installed.

    When you think something is wrong how Qwt gets installed on the Mac let me know how to fix the qwt project files.

    Uwe

  11. #11
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,294
    Thanked 877 Times in 825 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to get QWT 6.0.0 working on QT SDK v1.1.2 (based on QT v4.7.3) for Mac OS 10.

    Thinking twice about your situation I have to add the following:

    when you really have a different and binary incompatible version of Qt for the Creator and you want to use the Qwt plugin you always have to build and install Qwt twice - for the Qt version of your application and for the other one of the Creator.

    The recommended way to do this is to install Qwt into 2 different locations ( by editing qwtconfig.pri ), f.e. using paths like /usr/local/qwt-qt4.5-6.0.0. If you insist on copying the Qwt libraries into default paths you have to use different names for them.

    The situation of having different Qt libraries is not so unusual:

    • You might want to install the most recent version of Qt, but are still working with the version packaged by your distributor
    • You might want to have a new hot feature of the Creator - maybe available in a version with Qt 4.8 beta
    • You might have to maintain application code, that was written for some earlier Qt version


    Uwe

  12. #12
    Join Date
    Jul 2011
    Posts
    4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to get QWT 6.0.0 working on QT SDK v1.1.2 (based on QT v4.7.3) for Mac OS 10.

    Quote Originally Posted by Uwe View Post
    Thinking twice about your situation I have to add the following:

    when you really have a different and binary incompatible version of Qt for the Creator and you want to use the Qwt plugin you always have to build and install Qwt twice - for the Qt version of your application and for the other one of the Creator.
    No, that is redundant and not needed, and goes against your own advice of not having multiple copies of qwt around. You just need to build qwt once and make Qt Creator recognize it proprely. More on this below.

    Quote Originally Posted by Uwe View Post
    The recommended way to do this is to install Qwt into 2 different locations ( by editing qwtconfig.pri ), f.e. using paths like /usr/local/qwt-qt4.5-6.0.0. If you insist on copying the Qwt libraries into default paths you have to use different names for them.
    It is not the question of putting qwt in the default path or not. In my understanding the issue has something to do with the loading of libraries and frameworks on Mac as stated below.

    Quote Originally Posted by Uwe View Post
    The situation of having different Qt libraries is not so unusual:

    • You might want to install the most recent version of Qt, but are still working with the version packaged by your distributor
    • You might want to have a new hot feature of the Creator - maybe available in a version with Qt 4.8 beta
    • You might have to maintain application code, that was written for some earlier Qt version


    Uwe
    The impression I'm getting is that you are considering which set of QT frameworks (QtCore, QtGui, etc..) to load if one has more than one set around. But issue is more complicated in that the Mac OS is trying to load 2 different sets of frameworks at the same time with the regular use of libqwt_designer_plugin.dylib in Qt Creator.

    The following are the actual messages thrown by the system in such situation about loading 2 different copies of QtGui framework and associated complaints:

    Qt Code:
    1. dyld: loaded: /Developer/QtSDK/Qt Creator.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui
    2.  
    3. dyld: loaded: /Developer/QtSDK/Desktop/Qt/473/gcc/lib/QtGui.framework/Versions/Current/QtGui
    4.  
    5. objc[67118]: Class QCocoaColorPanelDelegate is implemented in both /Developer/QtSDK/Qt Creator.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui and /Developer/QtSDK/Desktop/Qt/473/gcc/lib/QtGui.framework/Versions/Current/QtGui. One of the two will be used. Which one is undefined.
    To copy to clipboard, switch view to plain text mode 

    This happens because the Qt Creator binary has information on its own self-contained set of QT frameworks to load, which is different than the information embedded in libqwt_designer_plugin.dylib, which uses another "SDK" version of QT frameworks. Therefore I'm experiencing crashes of Qt Creator when the system tries to load both, not just one set.

    I'm guessing here that the crashes are happening because of loading of 2 different sets of QT frameworks. May be the crash happens for a different reason. However, on the other hand, using any of the following 3 options, which forces the OS to use a single set of QT frameworks, makes Qt Creator and libqwt_designer_plugin.dylib happy and there are no crashes:

    (1) Use environment variables to force Qt Creator to use the set of Qt frameworks that qwt is linked with instead of its own supplied set. Unfortunately, in case I have missed, the INSTALL file supplied with qwt does not say how to do this properly. DYLD_LIBRARY_PATH alone does not suffice, as stated in the INSTALL file, since that is for dylibs. For frameworks, which are created by default compilation of qwt, you need to specify DYLD_FRAMEWORK_PATH=[PATH_TO_QTSDK_BASE]/QtSDK/Desktop/Qt/473/gcc/lib

    (2) Force QT and qwt frameworks to use the same set of libraries by reconfiguring the information embedded in binary code using otool commands as Phil has done above. But that is a cumbersome path to take.

    (3) Hard code the Frameworks directory on Qt Creator app to use ../../Desktop/Qt/473/gcc/lib Frameworks as I have done in step (4) of my first message in this thread above.

    Among the above 3 options I would recommend using either (1) or (3).

    Sincerely,

    Joofa
    Last edited by joofa; 31st July 2011 at 18:07.

  13. #13
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,294
    Thanked 877 Times in 825 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to get QWT 6.0.0 working on QT SDK v1.1.2 (based on QT v4.7.3) for Mac OS 10.

    Quote Originally Posted by joofa View Post
    No, that is redundant and not needed, and goes against your own advice of not having multiple copies of qwt around. You just need to build qwt once and make Qt Creator recognize it proprely.
    When you have 2 different Qt/Qwt applications one using Qt 4.5 and another using Qt 4.6 and both want to use Qwt 6.0.0 - you have to build Qwt 6.0.0 twice. ( The same but maybe more obvious is if you think about an application using Qwt 5.2 and Qt3.3 and another one using Qwt 5.2 and Qt 4.7. )

    It doesn't matter if one of these application is the Creator ( loading the Qwt library at runtime ) or any other type of application. Qwt libraries built against incompatible Qt versions are different and not redundant. If you don't take care of this fact don't be surprised, when the application crashes - or something less obvious happens for versions with only small differences.

    But my advice is not against more than one installation of Qwt on a system - it is against copying files manually, because an end user is usually not aware of all aspects and following your steps results in a broken installation.

    Quote Originally Posted by joofa View Post
    This happens because the Qt Creator binary has information on its own self-contained set of QT frameworks to load, which is different than the information embedded in libqwt_designer_plugin.dylib, which uses another "SDK" version of QT frameworks. Therefore I'm experiencing crashes of Qt Creator when the system tries to load both, not just one set.
    Yes exactly - this is why you need to load a designer plugin, that has been linked against a Qwt library, that was built against the same Qt version as the Creator was built with.

    Quote Originally Posted by joofa View Post
    However, on the other hand, using any of the following 3 options, which forces the OS to use a single set of QT frameworks ...
    Of course you can force an application to run against an slightly incompatible version of a library, but ...

    In your situation it might be the best to remove the pre-built package of the Creator and rebuild it yourself with the one Qt version you want to have on your system. Then everything else is easy.

    Uwe

  14. #14
    Join Date
    Jul 2011
    Posts
    4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to get QWT 6.0.0 working on QT SDK v1.1.2 (based on QT v4.7.3) for Mac OS 10.

    Quote Originally Posted by Uwe View Post
    Yes exactly - this is why you need to load a designer plugin, that has been linked against a Qwt library, that was built against the same Qt version as the Creator was built with.
    The QT Creator installed with 4.7.3 on Mac did not come with Headers for the Qt frameworks it is linked with, at least on my system. One can still go head and use the "SDK" headers but link with Qt Creator libraries, and it may work in practise, but in theory, it is a mismatch.

    Joofa
    Last edited by joofa; 31st July 2011 at 19:47.

  15. #15
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,294
    Thanked 877 Times in 825 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to get QWT 6.0.0 working on QT SDK v1.1.2 (based on QT v4.7.3) for Mac OS 10.

    It won't work in practice - as soon as the application is running on an incompatible API you will have unpredictable effects.

    Better throw this unfortunate Qt package from your system and build it yourself,

    Uwe

Similar Threads

  1. Qt-based dll: qApp = 0 !!
    By Elder Orb in forum Qt Programming
    Replies: 6
    Last Post: 14th September 2010, 16:15
  2. Replies: 0
    Last Post: 31st July 2010, 17:27
  3. UML Editors based on Qt
    By npclaudiu in forum General Programming
    Replies: 1
    Last Post: 25th March 2010, 22:08
  4. PNG-based animation
    By soul_rebel in forum Qt Programming
    Replies: 2
    Last Post: 31st December 2009, 21:33
  5. Analog ASP.NET based upon Qt.
    By Dark Amateur in forum Qt-based Software
    Replies: 1
    Last Post: 2nd September 2009, 09:06

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.