jsky
jsky

Reputation: 2217

How to fix missing qt widget library makefile link?

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?

Upvotes: 0

Views: 2901

Answers (1)

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

Upvotes: 4

Related Questions