Hi
I've installed opencv2.2 from source and tried to compile an example but i get this example :
symbol lookup error: /usr/lib/libQtOpenGL.so.4: undefined symbol:_ZN14QWidgetPrivate15checkWindowRoleEv
this is the main.cpp file :
Qt Code:
  1. #include <QtGui/QApplication>
  2. #include "widget.h"
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5. #include <math.h>
  6. #include "cv.h"
  7. #include <cvaux.h>
  8. #include <highgui.h>
  9. #include <cxcore.h>
  10.  
  11.  
  12. int main(int argc, char *argv[])
  13. {
  14. QApplication a(argc, argv);
  15. //Widget w;
  16. //w.show();
  17. IplImage* img = 0;
  18. int height,width,step,channels;
  19. uchar *data;
  20. int i,j,k;
  21.  
  22. if(argc<2){
  23. printf("Usage: main <image-file-name>\n\7");
  24. exit(0);
  25. }
  26.  
  27. // load an image
  28. img=cvLoadImage("/home/aladin/image1.png");
  29. if(!img){
  30. printf("Could not load image file: %s\n","/home/aladin/image1.png");
  31. exit(0);
  32. }
  33.  
  34. // get the image data
  35. height = img->height;
  36. width = img->width;
  37. step = img->widthStep;
  38. channels = img->nChannels;
  39. data = (uchar *)img->imageData;
  40. printf("Processing a %dx%d image with %d channels\n",height,width,channels);
  41.  
  42. // create a window
  43. cvNamedWindow("mainWin", CV_WINDOW_AUTOSIZE);
  44. cvMoveWindow("mainWin", 100, 100);
  45.  
  46. // invert the image
  47. for(i=0;i<height;i++) for(j=0;j<width;j++) for(k=0;k<channels;k++)
  48. data[i*step+j*channels+k]=255-data[i*step+j*channels+k];
  49.  
  50. // show the image
  51. cvShowImage("mainWin", img );
  52.  
  53. // wait for a key
  54. cvWaitKey(0);
  55.  
  56. // release the image
  57. cvReleaseImage(&img );
  58.  
  59. return a.exec();
  60. }
To copy to clipboard, switch view to plain text mode 

and this is the .pro file :
Qt Code:
  1. #-------------------------------------------------
  2. #
  3. # Project created by QtCreator 2011-05-10T14:34:50
  4. #
  5. #-------------------------------------------------
  6.  
  7. QT += core gui
  8.  
  9. TARGET = opencv2
  10. TEMPLATE = app
  11. target.path=/usr/local/bin
  12. INSTALLS=target
  13. INCLUDEPATH +=/usr/local/include/opencv/
  14. LIBS +=-lopencv_core -lopencv_imgproc -lopencv_calib3d -lopencv_video -lopencv_features2d -lopencv_ml -lopencv_highgui -lopencv_objdetect -lopencv_contrib -lopencv_legacy
  15.  
  16. SOURCES += main.cpp\
  17. widget.cpp
  18.  
  19. HEADERS += widget.h
To copy to clipboard, switch view to plain text mode 


please can someone help me to fix this ?

Thanks in advance.