Results 1 to 3 of 3

Thread: Opencv include problem

  1. #1
    Join Date
    Nov 2009
    Posts
    39
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Opencv include problem

    Hi, i`ve been reading a lot about how to configure OpenCV with QtCreator(the one i use) eclipse... dev-c++ .... and got nothing clear...

    I`ve installed openCV in Windows, and added de path to the system paths, and later on, i´ve created a project with the following .pro file:
    Qt Code:
    1. # -------------------------------------------------
    2. # Project created by QtCreator 2010-02-11T12:03:47
    3. # -------------------------------------------------
    4. QT += opengl
    5. TARGET = calibrar
    6. TEMPLATE = app
    7. LIBS += -LC:\OpenCV2.0\lib \
    8. -lhighgui200 \
    9. -lcv200 \
    10. -lcxcore200
    11. INCLUDEPATH += C:\OpenCV2.0\include\opencv
    12. SOURCES += main.cpp \
    13. mainwindow.cpp
    14. HEADERS += mainwindow.h
    To copy to clipboard, switch view to plain text mode 


    Then i have my mainwindow.cpp
    Qt Code:
    1. #include "mainwindow.h"
    2. #include <math.h>
    3. #include <cv.h>
    4. #include <cvaux.h>
    5. #include <highgui.h>
    6. MainWindow::MainWindow(QWidget *parent)
    7. : QMainWindow(parent)
    8. {
    9. }
    10. MainWindow::~MainWindow()
    11. {
    12.  
    13. }
    To copy to clipboard, switch view to plain text mode 

    The includes aren't underlined with yellow as happend the first times i tried, but when i try to build my program i get many errors from inside the opencv files!!!

    Qt Code:
    1. Running build steps for project calibrar...
    2. Configuration unchanged, skipping QMake step.
    3. Starting: C:/Qt/2009.04/mingw/bin/mingw32-make.exe -w
    4. mingw32-make: Entering directory `C:/Documents and Settings/Cesar/Mis documentos/calibrar'
    5. C:/Qt/2009.04/mingw/bin/mingw32-make -f Makefile.Debug
    6. mingw32-make[1]: Entering directory `C:/Documents and Settings/Cesar/Mis documentos/calibrar'
    7. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\..\Qt\2009.04\qt\include\QtCore" -I"..\..\..\..\Qt\2009.04\qt\include\QtGui" -I"..\..\..\..\Qt\2009.04\qt\include\QtOpenGL" -I"..\..\..\..\Qt\2009.04\qt\include" -I"..\..\..\..\OpenCV2.0\include\opencv" -I"..\..\..\..\Qt\2009.04\qt\include\ActiveQt" -I"debug" -I"..\..\..\..\Qt\2009.04\qt\mkspecs\win32-g++" -o debug\mainwindow.o mainwindow.cpp
    8.  
    9.  
    10.  
    11. //from here all red :)
    12.  
    13. [COLOR="red"]In file included from ../../../../OpenCV2.0/include/opencv/cxcore.hpp:2243,
    14. from ../../../../OpenCV2.0/include/opencv/cxcore.h:2123,
    15. from ../../../../OpenCV2.0/include/opencv/cv.h:58,
    16. from mainwindow.cpp:3:
    17. ../../../../OpenCV2.0/include/opencv/cxoperations.hpp: In member function `void cv::Ptr<_Tp>::addref()':
    18. ../../../../OpenCV2.0/include/opencv/cxoperations.hpp:1442: error: there are no arguments to `__exchange_and_add' that depend on a template parameter, so a declaration of `__exchange_and_add' must be available
    19. ../../../../OpenCV2.0/include/opencv/cxoperations.hpp:1442: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
    20. ../../../../OpenCV2.0/include/opencv/cxoperations.hpp: In member function `void cv::Ptr<_Tp>::release()':
    21. ../../../../OpenCV2.0/include/opencv/cxoperations.hpp:1446: error: there are no arguments to `__exchange_and_add' that depend on a template parameter, so a declaration of `__exchange_and_add' must be available
    22. ../../../../OpenCV2.0/include/opencv/cxoperations.hpp: In member function `cv::Ptr<_Tp>& cv::Ptr<_Tp>::operator=(const cv::Ptr<_Tp>&)':
    23. ../../../../OpenCV2.0/include/opencv/cxoperations.hpp:1473: error: there are no arguments to `__exchange_and_add' that depend on a template parameter, so a declaration of `__exchange_and_add' must be available
    24. In file included from ../../../../OpenCV2.0/include/opencv/cxcore.hpp:2244,
    25. from ../../../../OpenCV2.0/include/opencv/cxcore.h:2123,
    26. from ../../../../OpenCV2.0/include/opencv/cv.h:58,
    27. from mainwindow.cpp:3:
    28. ../../../../OpenCV2.0/include/opencv/cxmat.hpp: In copy constructor `cv::Mat::Mat(const cv::Mat&)':
    29. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:102: error: `__exchange_and_add' was not declared in this scope
    30. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:102: warning: unused variable '__exchange_and_add'
    31. ../../../../OpenCV2.0/include/opencv/cxmat.hpp: In constructor `cv::Mat::Mat(const cv::Mat&, const cv::Range&, const cv::Range&)':
    32. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:174: error: `__exchange_and_add' was not declared in this scope
    33. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:174: warning: unused variable '__exchange_and_add'
    34. ../../../../OpenCV2.0/include/opencv/cxmat.hpp: In constructor `cv::Mat::Mat(const cv::Mat&, const cv::Rect&)':
    35. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:189: error: `__exchange_and_add' was not declared in this scope
    36. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:189: warning: unused variable '__exchange_and_add'
    37. ../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `cv::Mat& cv::Mat::operator=(const cv::Mat&)':
    38. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:239: error: `__exchange_and_add' was not declared in this scope
    39. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:239: warning: unused variable '__exchange_and_add'
    40. ../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `void cv::Mat::addref()':
    41. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:342: error: `__exchange_and_add' was not declared in this scope
    42. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:342: warning: unused variable '__exchange_and_add'
    43. ../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `void cv::Mat::release()':
    44. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:346: error: `__exchange_and_add' was not declared in this scope
    45. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:346: warning: unused variable '__exchange_and_add'
    46. ../../../../OpenCV2.0/include/opencv/cxmat.hpp: In copy constructor `cv::MatND::MatND(const cv::MatND&)':
    47. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:3648: error: `__exchange_and_add' was not declared in this scope
    48. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:3648: warning: unused variable '__exchange_and_add'
    49. ../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `cv::MatND& cv::MatND::operator=(const cv::MatND&)':
    50. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:3677: error: `__exchange_and_add' was not declared in this scope
    51. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:3677: warning: unused variable '__exchange_and_add'
    52. ../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `void cv::MatND::addref()':
    53. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:3717: error: `__exchange_and_add' was not declared in this scope
    54. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:3717: warning: unused variable '__exchange_and_add'
    55. ../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `void cv::MatND::release()':
    56. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:3722: error: `__exchange_and_add' was not declared in this scope
    57. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:3722: warning: unused variable '__exchange_and_add'
    58. ../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `cv::SparseMat& cv::SparseMat::operator=(const cv::SparseMat&)':
    59. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:4081: error: `__exchange_and_add' was not declared in this scope
    60. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:4081: warning: unused variable '__exchange_and_add'
    61. ../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `void cv::SparseMat::addref()':
    62. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:4112: error: `__exchange_and_add' was not declared in this scope
    63. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:4112: warning: unused variable '__exchange_and_add'
    64. ../../../../OpenCV2.0/include/opencv/cxmat.hpp: In member function `void cv::SparseMat::release()':
    65. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:4116: error: `__exchange_and_add' was not declared in this scope
    66. ../../../../OpenCV2.0/include/opencv/cxmat.hpp:4116: warning: unused variable '__exchange_and_add'
    67. mingw32-make[1]: Leaving directory `C:/Documents and Settings/Cesar/Mis documentos/calibrar'
    68. mingw32-make: Leaving directory `C:/Documents and Settings/Cesar/Mis documentos/calibrar'
    69. mingw32-make[1]: *** [debug/mainwindow.o] Error 1
    70. mingw32-make: *** [debug] Error 2
    71. Exited with code 2.
    72. Error while building project calibrar
    73. When executing build step 'Make[/COLOR]'
    To copy to clipboard, switch view to plain text mode 


    Can anybody help me?
    Last edited by cae; 12th February 2010 at 08:38.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Opencv include problem

    I think this might help you...
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    cae (12th February 2010)

  4. #3
    Join Date
    Nov 2009
    Posts
    39
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Opencv include problem

    THANKS!!!!!!!!

    i've been 2 days stuck with that!!!

Similar Threads

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

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.