Install and use QWT under Mac OS X

三世轮回 提交于 2020-01-09 10:55:46

问题


I am currently trying to get QWT 6.1.0 running under MAC OS X 10.7.5. I followed the instructions over here --> http://qwt.sourceforge.net/qwtinstall.html I didn't changed something inside the configuration files.

So everything worked fine, but now I want to use the qwt-libary inside my own Project. I added the following line to my .pro

INCLUDEPATH +=  /Users/userX/Downloads/qwt-6.1.0/src

So my Project is now able to find all the header Files. But I also have to link against the libary. But I dont know how to do so. I tried using something like this:

LIBS  += -L /usr/local/qwt-6.1.0/lib -lqwt

But than I get an error called "libary not found for -lqwt".

What I am doing wrong? How can I link against the library or how could I import the qwt framework into my project?


回答1:


I found a solution. Here is a step by step guide on how to install QWT 6.1.0 under Mac OS X and get it running inside the QT-Creator :

  1. Download the .tar.bz2 from here http://sourceforge.net/projects/qwt/files/qwt/6.1.0/
  2. Extract it where you want, for Example inside your Download-Folder
  3. Then change into the directory qwt-6.1.0
  4. Then you have to locate the qmake command line tool ( you can do so by simply searchng for it inside the Finder.
  5. Then qmake the qwt.pro File like /Applications/QT/5.1.0/clang_64/bin/qmake qwt.pro
  6. make
  7. sudo make install
  8. Inside your QT Project you have to add the following line to the .pro File include ( /usr/local/qwt-6.1.0/features/qwt.prf ) includes QWT libary into Project
  9. Now you have to create a softlink like this : sudo ln -s /usr/local/qwt-6.1.0/lib/qwt.framework/qwt /usr/lib/qwt

Thats it. QWT now should work.

UNDER MAVERICKS:

If you are using Mavericks you have to manually copy the qwt.framework to Libary/Frameworks folder for not getting the "dyld: Library not loaded: libqwt.6.dylib" error .. i dont know why but it works.




回答2:


  1. Download the .tar.bz2 from here

  2. Extract it where you want, for Example inside your Download-Folder

  3. Then change into the directory qwt-6.1.4 (Example: mac:~ Apple$ cd downloads/qwt-6.1.4)
  4. Then qmake the qwt.pro (Example: mac:~ Apple$ /Users/(your name)/documents/qt/5.12.5/clang_64/bin/qmake qwt.pro)
  5. mac:~ Apple$ make
  6. mac:~ Apple$ sudo make install
  7. Inside your QT Project you have to add the following line to the .pro insert this line: "include ( /usr/local/qwt-6.1.4/features/qwt.prf )" without quotes
  8. Now you have to create a softlink like this: mac:~ Apple$ sudo ln -s/usr/local/qwt-6.1.4/lib/qwt.framework/qwt /usr/lib/qwt

If you have this error:

dyld: Library not loaded: qwt.framework/Versions/6/qwt
Referenced from: /Users/Desktop/build-check5-Desktop_Qt_5_12_5_clang_64bit2-Debug/check5.app/Contents/MacOS/check5
Reason: image not found

For MacOs Mojave you must copy qwt.framework to the Library/Frameworks folder.



来源:https://stackoverflow.com/questions/18588418/install-and-use-qwt-under-mac-os-x

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!