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.