简体   繁体   中英

Qt 5.4 Libraries and Netbeans 8 on OS X

I've searched through multiple questions on StackOverflow as well as other forums on the web, but I can't find an answer to this problem.

I'm trying to use Netbeans to build a Qt application (I prefer Netbeans over most other IDEs), and Netbeans can't seem to find some of the Qt libraries. I've added cmake/qmake to my C++ compiler paths, and included all the bin and lib folders in the Qt folder. I've also made sure that all necessary Qt modules are checked under Project Properties > Build > Qt > Qt Modules.

For example, the following include statement works, and Netbeans finds QtCore:

#include <QtCore>

However, Netbeans will warn about "unresolved includes" within QtCore, or any other module. Going into QtCore.h shows that many headers included in this file are not found or have unresolved includes as well.

I've physically tracked down those headers and included their directories in my project. What is my project configuration missing?

check if you have installed latest QT from http://www.qt.io/download-open-source/ or from http://www.qt.io/download-open-source/#section-2

These latest installation should be detected by NetBeans. If this also doesn't work try doing following steps -

  1. If you dont have homebrew installed, install it from http://brew.sh/

  2. Later in terminal do brew install qt5

  3. Do brew linkapps qt5 or brew link --force qt5
  4. Later do ln -s /usr/local/Cellar/qt5/5.4.1/mkspecs /usr/local/mkspecs & ln -s /usr/local/Cellar/qt5/5.4.1/plugins /usr/local/plugins

These steps should definitely solve your QT detection problem.

The steps provided by Tushar worked perfectly. I also took an extra step of pointing Netbeans to the qmake command under Preferences > C/C++. Not sure if this is absolutely required, but I did it just for peace of mind.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM