0

I was trying to look at this annotation library but it had a linking error in its makefile with QWidget

In file included from src/AnnotationsPixmapWidget.h:4:
src/PixmapWidget.h:4:10: fatal error: 'QWidget' file not found
#include <QWidget>
         ^

There is no such mention of this widget in the makefile.

I tried adding it here with similar linkages:
enter image description here

When i did that it gave me a permission error, i guess its compiling an object that is already existant.

 make
/usr/local/Cellar/qt5/5.3.1/lib/QtWidgets.framework/Versions/5/Headers/QWidget \
        /usr/local/Cellar/qt5/5.3.1/lib/QtWidgets.framework/Versions/5/Headers/qwidget.h
make: /usr/local/Cellar/qt5/5.3.1/lib/QtWidgets.framework/Versions/5/Headers/QWidget: Permission denied
make: *** [src/tmp/AnnotationsPixmapWidget.o] Error 1

Here is where its located: /usr/local/Cellar/qt5/5.3.1/lib/QtWidgets.framework/Versions/5/Headers/QWidget \ /usr/local/Cellar/qt5/5.3.1/lib/QtWidgets.framework/Versions/5/Headers/qwidget.h

The Qt5Widgets.pc package file seems to include the right directory:

Name: Qt5 Widgets
Description: Qt Widgets module
Version: 5.3.1
Libs: -F${libdir} -framework QtWidgets  
Libs.private: -F/usr/local/Cellar/qt5/5.3.1/lib -framework QtGui -framework QtCore -framework Carbon -framework Cocoa -lz -framework OpenGL -framework AGL  
Cflags: -I${includedir}/QtWidgets -I${includedir}
Requires: Qt5Core Qt5Gui

Update: tried adding QT += widget like here but get: Unknown module(s) in QT: widget

.pro file

# the target
TARGET = imgAnnotation
#DEFINES += NO_OPENCV # remove the '#' in order not to use opencv
OPENCV_ROOT = $(HOME)
#OPENCV_ROOT = c:/OpenCV2.0
#OPENCV_SUFFIX = 200


QT += widget

# some project options
TEMPLATE = app
CONFIG += release \
          warn_on \
          qt

# dirs for automatically generated files
MOC_DIR = src/tmp
OBJECTS_DIR = src/tmp
UI_DIR = src/ui

# source files
FORMS += src/*.ui
HEADERS += src/*.h \
    src/geometry/*.h \
    src/numeric/*.h
SOURCES += src/*.cpp

# lib/include dirs
INCLUDEPATH += src $${INCLUDEPATH}

# add opencv libraries and include path
!contains(DEFINES, NO_OPENCV) {
    LIBS += -lcv$${OPENCV_SUFFIX} -lcxcore$${OPENCV_SUFFIX} -L$${OPENCV_ROOT}/lib
    INCLUDEPATH += $${OPENCV_ROOT}/include
}

I dont really know all that much about makefiles, and i need this asap, otherwise id open up the book. where/how do i add it into the make file?

Community
  • 1
  • 1
jsky
  • 2,225
  • 5
  • 38
  • 54

1 Answers1

4

The module name is widgets (plural), not widget (singular).

Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313
  • thanks. (cant believe i missed that one). is there a similar module for /usr/local/Cellar/boost/1.57.0/include/boost/functional/hash/hash.hpp because im getting same error for this header file now. And i cant see a boost module.. – jsky May 26 '15 at 22:40
  • @jsky The modules apply to what comes with Qt, or what is designed to be usable from qmake. There's no boost module for qmake (unless you write one), so you have to add it manually. This is easy since large pieces of boost are header-only libraries. So you only need to add the correct include paths. But this is a separate question, and would be likely a duplicate anyway. Search for `qmake boost` to get some ideas first. – Kuba hasn't forgotten Monica May 27 '15 at 16:10
  • thanks @Kuba Ober i noticed this too tho haven't had time to fix it up just yet. – jsky May 30 '15 at 04:13