Results 1 to 4 of 4

Thread: Problem with QtCreator + OpenCV

  1. #1
    Join Date
    Jul 2010
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X

    Question Problem with QtCreator + OpenCV

    Hello
    This is my first post, first of all say that I have read many post on this forum and others but have not found the solution to my problem:
    http://labs.trolltech.com/forums/topic/1884
    http://www.qtcentre.org/threads/3217...ith-QT-creator
    ...

    My problem is that when compiling QtCreator I get the following error:
    Qt Code:
    1. Running steps for project build Qt ...
    2. Configuration Unchanged, skipping qmake step.
    3. Starting "/ usr / bin / make-w
    4. make: Entering directory `/ Users / Laura / Desktop / VC / Qt-build-desktop '
    5. / Usr / bin / qmake-spec / macx usr/local/Qt4.6/mkspecs/macx-g + +-Makefile-o .. / Qt / Qt.pro
    6. make: Leaving directory `/ Users / Laura / Desktop / VC / Qt-build-desktop '
    7. make: Entering directory `/ Users / Laura / Desktop / VC / Qt-build-desktop '
    8. g + +-headerpad_max_install_names-arch i386-o Qt.app / Contents / MacOS / Qt main.o mainwindow.o moc_mainwindow.o -F/Library/Frameworks -L/Library/Frameworks -L/opt/local/bin /-cxcore210 - cvaux210-cv210-highgui210-framework QtCore-framework QtGui
    9. Undefined symbols:
    10. "Cv:: fastFree (void *)", referenced from:
    11. cv:: Mat:: release () in main.o
    12. ld: symbol (s) not found
    13. collect2: ld returned 1 exit status
    14. make: *** [Qt.app / Contents / MacOS / Qt] Error 1
    15. make: Leaving directory `/ Users / Laura / Desktop / VC / Qt-build-desktop '
    16. The process "/ usr / bin / make" exited with code% 2.
    17. Error while building Qt project (target: Desktop)
    18. When executing build step 'Make'
    To copy to clipboard, switch view to plain text mode 
    My OS is: Mac OS X 10.6.4

    In .pro QtCreator towards I added the following lines:
    Qt Code:
    1. INCLUDEPATH + = "/ usr / local / include / opencv"
    2. LIBS + =-L '/ opt / Local / bin / "-cxcore210-cvaux210-cv210-highgui210
    To copy to clipboard, switch view to plain text mode 

    My PATH is:
    Qt Code:
    1. echo $ PATH
    2. / Usr / local / include / opencv: / opt / local / bin: / opt / local / sbin: / usr / bin: / bin: / usr / sbin: / sbin: / usr / local / bin: / usr / texbin : / usr/X11/bin
    To copy to clipboard, switch view to plain text mode 

    The program is an example, with an added line:
    Qt Code:
    1. # Include <QtGui/QApplication>
    2. # Include "mainwindow.h"
    3. # Include "cv.h"
    4. # Include "cxcore.h"
    5. # Include "highgui.h"
    6. using namespace cv;
    7. int main (int argc, char * argv [])
    8. (
    9. QApplication a (argc, argv);
    10. MainWindow w;
    11. w.show ();
    12. Mat matrix/ / line that fails
    13. return a.exec ();
    14. )
    To copy to clipboard, switch view to plain text mode 

    Any idea how to fix the error?

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Problem with QtCreator + OpenCV

    Are you really sure that this is correct?

    Qt Code:
    1. -L/opt/local/bin /-cxcore210 - cvaux210-cv210-highgui210-framework
    To copy to clipboard, switch view to plain text mode 

    Because I don't think so.

    I guess it should be more like
    Qt Code:
    1. -lcxcore -lcv -lcvaux -lhighgui -lml
    To copy to clipboard, switch view to plain text mode 
    Maybe with a version number like 210.

  3. #3
    Join Date
    Jul 2010
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X

    Thumbs down Re: Problem with QtCreator + OpenCV

    No, I am not sure, I tested 10 000 things, but if I put
    Qt Code:
    1. LIBS += -lcv
    To copy to clipboard, switch view to plain text mode 
    I get the following error:
    Qt Code:
    1. Running build steps for project Qt...
    2. Configuration unchanged, skipping qmake step.
    3. Starting: "/usr/bin/make" -w
    4. make: Entering directory `/Users/Laura/Desktop/VC/Qt-build-desktop'
    5. g++ -headerpad_max_install_names -arch i386 -o Qt.app/Contents/MacOS/Qt main.o mainwindow.o moc_mainwindow.o -F/Library/Frameworks -L/Library/Frameworks -lcv -framework QtGui -framework QtCore
    6. ld: warning: in /usr/lib/libcv.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
    7. Undefined symbols:
    8. "cv::fastFree(void*)", referenced from:
    9. cv::Mat::release() in main.o
    10. ld: symbol(s) not found
    11. collect2: ld returned 1 exit status
    12. make: *** [Qt.app/Contents/MacOS/Qt] Error 1
    13. make: Leaving directory `/Users/Laura/Desktop/VC/Qt-build-desktop'
    14. The process "/usr/bin/make" exited with code %2.
    15. Error while building project Qt (target: Desktop)
    16. When executing build step 'Make'
    To copy to clipboard, switch view to plain text mode 
    and -lcv210 not find it (I have installed opencv2.1)

  4. #4
    Join Date
    Sep 2010
    Posts
    1
    Qt products
    Qt3
    Platforms
    Windows

    Lightbulb Re: I hooe this is not a late help bro.

    Hello,
    Hello:
    I faced the same problem while trying to use OpenCv library with Qt!
    I am using:
    1) OpenCv2.0
    2) Qt Creator 2.01 Based on Qt 4.7.0 (32 bit)
    3) Windows Xp

    So I solved the problem by adding the following tags in the .pro file:

    LIBS += -L C:\OpenCV2.0\bin -lcxcore200 -lcv200 -lcvaux200 -lhighgui200 -lml200 -lcxts200
    INCLUDEPATH += C:/OpenCV2.0/include/opencv


    Hope this will work

Similar Threads

  1. OpenCv Problem
    By danics in forum Qt Programming
    Replies: 1
    Last Post: 13th April 2010, 11:40
  2. Problem wth Opencv & Qt 4
    By Casper2004 in forum Qt Programming
    Replies: 0
    Last Post: 28th September 2009, 10:33
  3. Replies: 1
    Last Post: 1st July 2009, 10:19
  4. I've got a qt&opencv problem.
    By eralvc in forum Installation and Deployment
    Replies: 2
    Last Post: 23rd October 2008, 10:58

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.