Ask Your Question
0

OpenCV integration with Qt

asked 2016-05-18 23:43:55 -0600

trav gravatar image

Version: opencv-3.1.0 Language : C++

Hello everyone,

I have been having a reoccurring problem that is really slowing me down.. I'm new to C++ and really want to learn and get into openCV . I have successfully integrated this with Xcode on my mac but am unable to do this with Qt .. Here what I have done so far (below) I have added this to my project but keep getting an error saying 'libraries/openCV not found'

-------------------------------------------------

#

Project created by QtCreator 2016-05-15T23:16:25

#

-------------------------------------------------

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = cam TEMPLATE = app

// new QT += core QT -= gui

TARGET = RP_openCV_01 CONFIG += console CONFIG -= app_bundle

TEMPLATE = app

SOURCES += main.cpp\ mainwindow.cpp

LIBS += -L/opt/local/lib \ -lopencv_highgui.3.1.0 \ -lopencv_core.3.1.0

INCLUDEPATH += /opt/local/include

HEADERS += mainwindow.h

FORMS += mainwindow.ui

edit retag flag offensive close merge delete

Comments

Could you please copy and paste the error from the compiler output of qt creator so as to make things more clearer.

lama123 gravatar imagelama123 ( 2016-05-19 00:57:03 -0600 )edit

22:41:46: Starting: "/usr/bin/make" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.7 -Wall -W -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../CV -I. -I../../Qt/5.6/clang_64/lib/QtWidgets.framework/Headers -I../../Qt/5.6/clang_64/lib/QtGui.framework/Headers -I../../Qt/5.6/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenGL.framewor

trav gravatar imagetrav ( 2016-05-19 21:42:57 -0600 )edit

I did have this first installed on Xcode on my mac... and then switched to Qt hence why you see Xcode in the output. Sorry for the long response as well

trav gravatar imagetrav ( 2016-05-19 21:44:13 -0600 )edit

sorry, but i don't see the error in the above compiler output. You need to copy and paste the error part from the qt creator IDE output pane.

lama123 gravatar imagelama123 ( 2016-05-19 23:38:39 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-05-21 20:13:59 -0600

trav gravatar image

Hey, thanks for your help I actually got it and have reproduced the desired outcome... essentially what happened because I am new to Qt & OpenCV etc. It seems I have placed the code before Sources' in the project.pro file which produced the errors... I did this before as well I don't quite understand why it decides to work now but did not before? but essentially I'm good :) thanks for support

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-05-18 23:43:55 -0600

Seen: 614 times

Last updated: May 21 '16