The QtCreator run the program normally. However, in order to test memory, I need to run it from command line. When I make it,
Qt Code:
  1. make -lGLEW -lGL
  2.  
  3. g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -Iudp -Ithread_safe -I. -I. -o camera.o camera.cpp
  4. In file included from camera.cpp:1:0:
  5. camera.h:4:21: fatal error: QGLWidget: No such file or directory
  6. compilation terminated.
To copy to clipboard, switch view to plain text mode 

As I checked the .pro file, what it includes is exactly the same thing that QtCreator has when it runs the program successfully.

.pro file:
Qt Code:
  1. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets opengl
  2.  
  3. TARGET = SonarDisplay
  4. TEMPLATE = app
  5.  
  6. LIBS += -lGLEW -lGL
  7. ...
To copy to clipboard, switch view to plain text mode 

Am I missing something?