Results 1 to 6 of 6

Thread: How to Link OpenCV 2.4.9 & Qt in MacOS

  1. #1
    Join Date
    Sep 2014
    Posts
    6
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Program to test the OpenCV and QT Creator

    Hi ...
    I have just installed OpenCV and QT5 using homebrew in Mac OS X Mavericks.
    and installed QT Creator....

    I have no idea to make a new program in QT Creator using OpenCV..
    Please share a basic program which links Opencv and QT Creator and let me know hot to create a new project in Qt creator using OpenCV

    Thx.

  2. #2
    Join Date
    Sep 2014
    Posts
    6
    Qt products
    Qt5
    Platforms
    MacOS X

    Default How to Link OpenCV 2.4.9 & Qt in MacOS

    Hello there...

    I have installed OpenCV using Homebrew in Mac OS Mavericks and QT Creator from the website.

    I am trying to test OpenCV & QT Creator using a simple program from the internet, but I am ending up with some errors.

    I donno wats going wrong.... I am new to Opencv and QT ... Your Help is much appreciated..

    Below are my project details. Guide me for my first ever OpenCV & QT with Mac OS X Program......

    Thx.

    --- Untitled.pro File ---

    QT += core

    QT -= gui

    TARGET = untitled1

    CONFIG += console

    CONFIG -= app_bundle

    TEMPLATE = app

    SOURCES += main.cpp

    LIBS += -L/usr/local/Cellar/opencv/2.4.9/lib \

    -lopencv_highgui \

    -lopencv_imgproc \

    -lopencv_core \

    -lopencv_features2d \

    -lopencv_calib3d \

    INCLUDEPATH += /usr/local/Cellar/opencv/2.4.9/include \



    --- Source File - main.cpp ---

    include opencv2/core/core.hpp

    include opencv2/highgui/highgui.hpp

    include iostream

    include opencv/cv.h

    using namespace cv;

    int main()

    {

    std::cout << "Hello World!" << std::endl;

    cv::Mat mat;

    mat = cv::imread("Unknown.JPEG");

    cvNamedWindow("hello");

    cv::imshow("hello",mat);

    cvWaitKey(0);

    return 0;
    }


    --- The Compile Output with Errors ---

    14:30:57: Running steps for project untitled... 14:30:57: Configuration unchanged, skipping qmake step. 14:30:57: Starting: "/usr/bin/make" /Users/Macs/Qt/5.3.1/bin/qmake -spec macx-g++ CONFIG+=debug CONFIG+=x86_64 -o Makefile ../untitled/untitled.pro /Applications/Xcode.app/Contents/Developer/usr/bin/g++ -headerpad_max_install_names -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.6 -o untitled main.o -F/usr/local/Cellar/qt5/5.3.1/lib -L/usr/local/Cellar/opencv/2.4.9/lib -lopencv_highgui -lopencv_imgproc -lopencv_core -lopencv_features2d -lopencv_calib3d -framework QtCore Undefined symbols for architecture x86_64: "cv::imread(std::string const&, int)", referenced from: _main in main.o "cv::imshow(std::string const&, cv::_InputArray const&)", referenced from: _main in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: * [untitled] Error 1 14:30:57: The process "/usr/bin/make" exited with code 2. Error while building/deploying project untitled (kit: Desktop) When executing step "Make" 14:30:57: Elapsed time: 00:00.

  3. #3
    Join Date
    Aug 2014
    Posts
    9
    Thanks
    2
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Program to test the OpenCV and QT Creator

    Have you linked openCV library with Qt?

    jakr1387
    Last edited by Jakr1387; 11th September 2014 at 12:37.

  4. #4
    Join Date
    Sep 2014
    Posts
    6
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: Program to test the OpenCV and QT Creator

    Its a Gud Question....the answer is no....
    Trying to link...but no luck...Any idea to link ?

  5. #5
    Join Date
    Sep 2014
    Posts
    6
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: Program to test the OpenCV and QT Creator

    Hi !

    Gud News .... works like charm

    I restored my Mac with Time Machine and I just build OpenCV 2.4.9 from the source, added Kits & Version to QT creator its working now....

    I am using Mac OS X 10.9.4, OpenCV 2.4.9, and Qt Creator 3.2.0 Based on Qt 5.3.1 (Clang 5.0 (Apple), 64 bit)

    Thanks for your support.... Macs

  6. #6
    Join Date
    Sep 2014
    Posts
    6
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: How to Link OpenCV 2.4.9 & Qt in MacOS

    Hi !

    Gud News .... works like charm

    I restored my Mac with Time Machine and I just build OpenCV 2.4.9 from the source, added Kits & Version to QT creator its working now....

    I am using Mac OS X 10.9.4, OpenCV 2.4.9, and Qt Creator 3.2.0 Based on Qt 5.3.1 (Clang 5.0 (Apple), 64 bit)

    Thanks for your support.... Macs

Similar Threads

  1. Couldn't link opencv with qt creator , this error happens
    By Being friendzoned sucks in forum Qt Programming
    Replies: 11
    Last Post: 4th May 2014, 00:39
  2. Replies: 4
    Last Post: 6th March 2014, 05:57
  3. Replies: 11
    Last Post: 5th May 2011, 14:05
  4. OpenCV with MacOS 10.6 Example?
    By nelagnelag in forum Qt Programming
    Replies: 0
    Last Post: 16th August 2010, 17:08
  5. QT-opencv-MACOS
    By ireneluis in forum Qt Programming
    Replies: 0
    Last Post: 15th March 2010, 04:25

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.