LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   QT #include <QGLWidget> no such file or directory problem (https://www.linuxquestions.org/questions/programming-9/qt-include-qglwidget-no-such-file-or-directory-problem-883534/)

ZebraIzToronto 05-30-2011 11:31 AM

QT #include <QGLWidget> no such file or directory problem
 
I have installed QT on Slackware 13.37 x64 and when I create gui project it works ok, but I need OpenGL. When I add #include <QGLWidget>
I get error No such file or directory
there is my env
Quote:

CPLUS_INCLUDE_PATH=/usr/lib/qt/include
MANPATH=/usr/local/man:/usr/man:/usr/lib/java/man:/usr/share/texmf/man
KDE_MULTIHEAD=false
HZ=100
HOSTNAME=dominum.dominum
TERM=xterm
SHELL=/bin/bash
DESKTOP_STARTUP_ID=
XDG_SESSION_COOKIE=bff524003862aa14abea23da0000001d-1306791455.685012-917016213
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/root/.gtkrc-2.0::/root/.kde/share/config/gtkrc-2.0
GS_LIB=/root/.fonts
GTK_RC_FILES=/etc/gtk/gtkrc:/root/.gtkrc::/root/.kde/share/config/gtkrc
WINDOWID=65011716
HUSHLOGIN=FALSE
KDE_FULL_SESSION=true
USER=root
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31; 01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.bat=01;32:*.BAT=01;32:*.btm=01;3 2:*.BTM=01;32:*.cmd=01;32:*.CMD=01;32:*.com=01;32:*.COM=01;32:*.dll=01;32:*.DLL=01;32:*.exe=01;32:*. EXE=01;32:*.7z=01;31:*.ace=01;31:*.ACE=01;31:*.arj=01;31:*.bz2=01;31:*.cpio=01;31:*.deb=01;31:*.dz=0 1;31:*.gz=01;31:*.jar=01;31:*.lzh=01;31:*.lzma=01;31:*.rar=01;31:*.RAR=01;31:*.rpm=01;31:*.rz=01;31: *.tar=01;31:*.taz=01;31:*.tb2=01;31:*.tbz2=01;31:*.tbz=01;31:*.tgz=01;31:*.tlz=01;31:*.trz=01;31:*.t xz=01;31:*.tz=01;31:*.tz2=01;31:*.xz=01;31:*.z=01;31:*.Z=01;31:*.zip=01;31:*.ZIP=01;31:*.zoo=01;31:* .aac=01;35:*.AAC=01;35:*.anx=01;35:*.asf=01;35:*.ASF=01;35:*.au=01;35:*.axa=01;35:*.axv=01;35:*.avi= 01;35:*.AVI=01;35:*.bmp=01;35:*.BMP=01;35:*.divx=01;35:*.DIVX=01;35:*.flac=01;35:*.FLAC=01;35:*.gif= 01;35:*.GIF=01;35:*.jpg=01;35:*.JPG=01;35:*.jpeg=01;35:*.JPEG=01;35:*.m2a=01;35:*.M2A=01;35:*.m2v=01 ;35:*.M2V=01;35:*.m4a=01;35:*.M4A=01;35:*.m4p=01;35:*.M4P=01;35:*.m4v=01;35:*.M4V=01;35:*.mid=01;35: *.midi=01;35:*.mka=01;35:*.mkv=01;35:*.MKV=01;35:*.mov=01;35:*.MOV=01;35:*.mp3=01;35:*.MP3=01;35:*.m p4=01;35:*.MP4=01;35:*.mp4v=01;35:*.mpc=01;35:*.MPC=01;35:*.mpeg=01;35:*.MPEG=01;35:*.mpg=01;35:*.MP G=01;35:*.nuv=01;35:*.oga=01;35:*.ogv=01;35:*.ogx=01;35:*.ogg=01;35:*.OGG=01;35:*.pbm=01;35:*.pgm=01 ;35:*.png=01;35:*.PNG=01;35:*.ppm=01;35:*.qt=01;35:*.ra=01;35:*.RA=01;35:*.ram=01;35:*.RAM=01;35:*.r m=01;35:*.RM=01;35:*.spx=01;35:*.svg=01;35:*.svgz=01;35:*.tga=01;35:*.TGA=01;35:*.tif=01;35:*.TIF=01 ;35:*.tiff=01;35:*.TIFF=01;35:*.vob=01;35:*.VOB=01;35:*.wav=01;35:*.WAV=01;35:*.wma=01;35:*.WMA=01;3 5:*.wmv=01;35:*.WMV=01;35:*.xbm=01;35:*.xcf=01;35:*.xpm=01;35:*.xspf=01;35:*.xwd=01;35:*.XWD=01;35:* .xvid=01;35:
GDK_USE_XFT=1
SESSION_MANAGER=local/dominum:@/tmp/.ICE-unix/2290,unix/dominum:/tmp/.ICE-unix/2290
T1LIB_CONFIG=/usr/share/t1lib/t1lib.config
XDG_CONFIG_DIRS=/etc/xdg:/etc/kde/xdg:/etc/xfce/xdg
MINICOM=-c on
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/java/bin:/usr/lib/kde4/libexec:/usr/lib/qt/bin:/usr/share/texmf/bin
MAIL=/var/spool/mail/root
LC_COLLATE=C
INPUTRC=/etc/inputrc
PWD=/root
JAVA_HOME=/usr/lib/java
KDE_SESSION_UID=0
LANG=en_US
KDEDIRS=/usr
QT4DIR=/usr/lib/qt
HOME=/root
SHLVL=5
KDE_SESSION_VERSION=4
XCURSOR_THEME=Oxygen_Black
LS_OPTIONS=-F -b -T 0 --color=auto
LESS=-M
LOGNAME=root
XDG_DATA_DIRS=/usr/share:/usr/share:/usr/local/share
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-vYvCczqBpp,guid=600e86ebb13988596a94ac1800000034
LESSOPEN=|lesspipe.sh %s
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
WINDOWPATH=7
DISPLAY=:0.0
QT_PLUGIN_PATH=/root/.kde/lib/kde4/plugins/:/usr/lib/kde4/plugins/
G_BROKEN_FILENAMES=1
COLORTERM=Terminal
XAUTHORITY=/tmp/kde-root/xauth-0-_0
_=/usr/bin/env
What is my mistake ?

Nylex 05-30-2011 11:37 AM

Well, QGLWidget is in /usr/lib/qt/include/QtOpenGL/, so perhaps you need to change your include directive to

#include <QtOpenGL/QGLWidget>

or change the list of include directories to include /usr/lib/qt/include/QtOpenGL.

How are you compiling your code? I don't use Qt, so I may not really be able to help, but we'll see.

SigTerm 05-30-2011 11:45 AM

Quote:

Originally Posted by Nylex (Post 4371146)
Well, QGLWidget is in /usr/lib/qt/include/QtOpenGL/, so perhaps

This is not a correct solution.

Quote:

Originally Posted by ZebraIzToronto (Post 4371141)
What is my mistake ?

Add this line to your *.pro file:
Code:

QT += opengl
and recreate makefile for your project using qmake.


All times are GMT -5. The time now is 12:25 PM.