Results 1 to 2 of 2

Thread: Problem with Integrating QT Creator and OPENCV

  1. #1
    Join Date
    Jul 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Problem with Integrating QT Creator and OPENCV

    Hello everyone,
    I will apologize in advance for asking this because I know this is a topic that's been discussed , but unfortunately for me none of the many topics I've searched have helped me.

    I am trying to write a simple program using opencv in QT CREATOR(few lines of code involving basic opencv functions), but am receiving errors as such:
    " error: undefined reference to `cvNamedWindow' "
    here is the pro file
    Qt Code:
    1. HEADERS = patientdata.h \
    2. recordingSoftwareGui.h \
    3. functions.h \
    4. filemanagement.h \
    5. patienttrial.h \
    6. addtrialdialog.h \
    7. asciiTable.h \
    8. Rectangle.h \
    9. Point.h
    10. SOURCES = main.cpp \
    11. patientdata.cpp \
    12. functions.cpp \
    13. recordingSoftwareGui.cpp \
    14. filemanagement.cpp \
    15. patienttrial.cpp \
    16. addtrialdialog.cpp
    17. FORMS = recordingSoftwareGui.ui \
    18. addtrialdialog.ui
    19.  
    20. INCLUDEPATH+= D:\OPENCV240MIN2\install\include\
    21. D:\OPENCV240MIN2\install\include\opencv \
    22. D:\OPENCV240MIN2\install\include\opencv2 \
    23. D:\OPENCV240MIN2\install\include\opencv2\calib3d \
    24. D:\OPENCV240MIN2\install\include\opencv2\contrib \
    25. D:\OPENCV240MIN2\install\include\opencv2\core \
    26. D:\OPENCV240MIN2\install\include\opencv2\features2d \
    27. D:\OPENCV240MIN2\install\include\opencv2\flann \
    28. D:\OPENCV240MIN2\install\include\opencv2\gpu \
    29. D:\OPENCV240MIN2\install\include\opencv2\highgui \
    30. D:\OPENCV240MIN2\install\include\opencv2\legacy \
    31. D:\OPENCV240MIN2\install\include\opencv2\ml \
    32. D:\OPENCV240MIN2\install\include\opencv2\nonfree \
    33. D:\OPENCV240MIN2\install\include\opencv2\objdetect \
    34. D:\OPENCV240MIN2\install\include\opencv2\photo \
    35. D:\OPENCV240MIN2\install\include\opencv2\stitching \
    36. D:\OPENCV240MIN2\install\include\opencv2\ts \
    37. D:\OPENCV240MIN2\install\include\opencv2\video \
    38. D:\OPENCV240MIN2\install\include\opencv2\videostab
    39.  
    40. LIBS+=-L"D:\OPENCV240MIN2\install\lib"
    To copy to clipboard, switch view to plain text mode 

    I have tried 5-6 different versions of opencv- some of which compiled with mingw , some of which precompiled with MSVC.
    I have made sure to compile opencv with the same gcc and g++ that QT uses.
    Yet I still am not making any progress ; I am using QT version 4.8.0 if that makes any difference.
    Any help would be appreciated , thank you.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem with Integrating QT Creator and OPENCV

    Use / in preference to \ in file paths in the PRO file (actually anywhere in Qt).

    Line 20 should have a space before the continuation \ or it will run together with line 21

    Line 40 should list the libraries that you wish the program to link against (-l options). You currently list none, only a search location (-L option)

Similar Threads

  1. integrating openCv with QtQuick
    By nitish in forum Qt Quick
    Replies: 1
    Last Post: 24th September 2011, 13:16
  2. Integrating Qt quick with opencv
    By nitish in forum General Discussion
    Replies: 0
    Last Post: 16th September 2011, 09:17
  3. Problem with openCV compilation in Qt Creator
    By mind_freak in forum Qt Programming
    Replies: 2
    Last Post: 22nd February 2011, 12:26
  4. Using OpenCV with QT creator
    By gmiller39 in forum Newbie
    Replies: 3
    Last Post: 7th July 2010, 15:32
  5. Integrating opencv with QT in visualstudio 2008
    By reem in forum Qt Programming
    Replies: 1
    Last Post: 12th April 2010, 09:12

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.