Hello Ketan,

I am creating a static library that includes glew. I have provided the include path now in the Qt's .pro file


*******************************'
............

.............

g++ -c -pipe -O2 -fPIC -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_NO_DEBUG -DQT_OPENGL_LIB -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/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I. -I../SiMath -I/usr/include/GL -I/usr/X11R6/include -I../../Build/SiUtil/Release -I. -o ../../Build/SiUtil/Release/SiGLInfo.o SiGLInfo.cpp
..................

...................

*******************************

But having error while the main application call the header file.

Where do i have to write the preprocessor token GLEW_STATIC.

And the manual  says that token is for windows platform, i am in linux.

Regards
Sajjad


---------- Forwarded message ----------
From: Ketan Mehta <ketan.mehta@gmail.com>
Date: Mon, Feb 23, 2009 at 3:17 AM
Subject: Re: [glew-users] Fwd: GLEW Qt
To: ami guru <dosto.walla@gmail.com>


Yes,

But that is for include path, in order to link to the static library
you need to specify as you mentioned.

But I did not see anything here:

g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB
> -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/QtCore
> -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui
> -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4
> -I. -I../../../Includes/SiUtil -I../../../Includes/SiMath
> -I/usr/X11R6/include -I../../../Build/displayListAndOther/Release -I. -o
> ../../../Build/displayListAndOther/Release/GLPrimitiveMainWindow.o
> GLPrimitiveMainWindow.cpp

yes, -lGLEW is correct and I am sure you are doing it right as current
errors are redefinition and you are not even linking :)

Ketan

On Sun, Feb 22, 2009 at 7:39 PM, ami guru <dosto.walla@gmail.com> wrote:
> Hello Mehta,
>
> I did not understand what you have said by "I don't see any GLEW libary in
> the command line for g++"
>
> GLEW library is already installed and /usr/include/GL path is already set in
> the environment variable.
>
> So i just need to link it up with -lGLEW. Isnt it?
>
>
>
> On Mon, Feb 23, 2009 at 12:14 AM, Ketan Mehta <ketan.mehta@gmail.com> wrote:
>>
>> Hi Sajjid,
>>
>> I don't see any GLEW libary in the command line for g++, so if you are
>> including glew directly then
>> you  may have to declare the GLEW_STATIC as pre-processor define,
>> check advance usage.
>>
>> Ketan
>>
>> On Sun, Feb 22, 2009 at 4:23 PM, ami guru <dosto.walla@gmail.com> wrote:
>> > Hello Tom,
>> >
>> > I think i restructured as you have suggested ,but still having the same
>> > error.
>> >
>> > So i think it is better to elaborate to make sure that i did follow you.
>> >
>> >
>> > I have a file named SiGLUtil.h and SiGLUtil.cpp where i declare and
>> > define
>> > all the Opengl related functions.
>> > I have defined function that instantiate the glew(). No Qt related
>> > functions
>> > reside here as you have suggested.
>> >
>> > Then with use of qmake i have created a staic library put that inside
>> > the
>> > directory .../Lib/SiUtil.a
>> >
>> >
>> > There is a separate folder where i have the main application. I
>> > subclassed
>> > QGLwidget and in the header file i have included SiGLUtil.h
>> >
>> > Is that OK?
>> >
>> >
>> > Regards
>> > Sajjad
>> >
>> > **********************************'ERROR
>> > MESSAGE******************************
>> > g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB
>> > -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/QtCore
>> > -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui
>> > -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtOpenGL
>> > -I/usr/include/qt4
>> > -I. -I../../../Includes/SiUtil -I../../../Includes/SiMath
>> > -I/usr/X11R6/include -I../../../Build/displayListAndOther/Release -I. -o
>> > ../../../Build/displayListAndOther/Release/GLPrimitiveMainWindow.o
>> > GLPrimitiveMainWindow.cpp
>> > g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_OPENGL_LIB
>> > -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/QtCore
>> > -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui
>> > -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtOpenGL
>> > -I/usr/include/qt4
>> > -I. -I../../../Includes/SiUtil -I../../../Includes/SiMath
>> > -I/usr/X11R6/include -I../../../Build/displayListAndOther/Release -I. -o
>> > ../../../Build/displayListAndOther/Release/GLWidget.o GLWidget.cpp
>> > In file included from ../../../Includes/SiUtil/SiBasic.h:21,
>> >                  from ../../../Includes/SiUtil/SiGLUtil.h:5,
>> >                  from GLWidget.h:4,
>> >                  from GLWidget.cpp:6:
>> > /usr/include/GL/glew.h:84:2: error: #error gl.h included before glew.h
>> > /usr/include/GL/glew.h:87:2: error: #error glext.h included before
>> > glew.h
>> > In file included from ../../../Includes/SiUtil/SiBasic.h:21,
>> >                  from ../../../Includes/SiUtil/SiGLUtil.h:5,
>> >                  from GLWidget.h:4,
>> >                  from GLWidget.cpp:6:
>> > /usr/include/GL/glew.h:8422: error: conflicting declaration 'typedef
>> > void (*
>> > PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)(GLenum, GLfloat*)'
>> > /usr/include/GL/glext.h:5201: error: 'PFNGLFRAGMENTLIGHTMODELFVSGIXPROC'
>> > has
>> > a previous declaration as 'typedef void (*
>> > PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)(GLenum, const GLfloat*)'
>> > /usr/include/GL/glew.h:8424: error: conflicting declaration 'typedef
>> > void (*
>> > PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)(GLenum, GLint*)'
>> > /usr/include/GL/glext.h:5203: error: 'PFNGLFRAGMENTLIGHTMODELIVSGIXPROC'
>> > has
>> > a previous declaration as 'typedef void (*
>> > PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)(GLenum, const GLint*)'
>> > /usr/include/GL/glew.h:8426: error: conflicting declaration 'typedef
>> > void (*
>> > PFNGLFRAGMENTLIGHTFVSGIXPROC)(GLenum, GLenum, GLfloat*)'
>> > /usr/include/GL/glext.h:5197: error: 'PFNGLFRAGMENTLIGHTFVSGIXPROC' has
>> > a
>> > previous declaration as 'typedef void (*
>> > PFNGLFRAGMENTLIGHTFVSGIXPROC)(GLenum, GLenum, const GLfloat*)'
>> > /usr/include/GL/glew.h:8428: error: conflicting declaration 'typedef
>> > void (*
>> > PFNGLFRAGMENTLIGHTIVSGIXPROC)(GLenum, GLenum, GLint*)'
>> > /usr/include/GL/glext.h:5199: error: 'PFNGLFRAGMENTLIGHTIVSGIXPROC' has
>> > a
>> > previous declaration as 'typedef void (*
>> > PFNGLFRAGMENTLIGHTIVSGIXPROC)(GLenum, GLenum, const GLint*)'
>> > /usr/include/GL/glew.h:8435: error: conflicting declaration 'typedef
>> > void (*
>> > PFNGLGETFRAGMENTMATERIALFVSGIXPROC)(GLenum, GLenum, const GLfloat*)'
>> > /usr/include/GL/glext.h:5210: error:
>> > 'PFNGLGETFRAGMENTMATERIALFVSGIXPROC'
>> > has a previous declaration as 'typedef void (*
>> > PFNGLGETFRAGMENTMATERIALFVSGIXPROC)(GLenum, GLenum, GLfloat*)'
>> > /usr/include/GL/glew.h:8436: error: conflicting declaration 'typedef
>> > void (*
>> > PFNGLGETFRAGMENTMATERIALIVSGIXPROC)(GLenum, GLenum, const GLint*)'
>> > /usr/include/GL/glext.h:5211: error:
>> > 'PFNGLGETFRAGMENTMATERIALIVSGIXPROC'
>> > has a previous declaration as 'typedef void (*
>> > PFNGLGETFRAGMENTMATERIALIVSGIXPROC)(GLenum, GLenum, GLint*)'
>> > /usr/include/GL/glew.h:9866: error:
>> > 'PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC' does not name a type
>> > /usr/include/GL/glew.h:9867: error:
>> > 'PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC' does not name a type
>> > GLWidget.cpp:128: warning: unused parameter 'struct_string'
>> > make[3]: *** [../../../Build/displayListAndOther/Release/GLWidget.o]
>> > Error 1
>> > make[3]: Leaving directory
>> > `/home/sajjad/QT/volumizer/SiMain/OpenGL/displayListAndOther'
>> > make[2]: *** [sub-displayListAndOther-make_default] Error 2
>> > make[2]: Leaving directory `/home/sajjad/QT/volumizer/SiMain/OpenGL'
>> > make[1]: *** [sub-OpenGL-make_default] Error 2
>> > make[1]: Leaving directory `/home/sajjad/QT/volumizer/SiMain'
>> > make: *** [sub-SiMain-make_default] Error 2
>> > sajjad@sajjad:~/QT/volumizer$
>> >
>> >
>> >
>> > ***********************************
>> >
>> > ---------- Forwarded message ----------
>> > From: tom fogal <tfogal@alumni.unh.edu>
>> > Date: Sun, Feb 22, 2009 at 8:56 PM
>> > Subject: Re: [glew-users] GLEW Qt
>> > To: ami guru <dosto.walla@gmail.com>
>> > Cc: glew-users@lists.sourceforge.net
>> >
>> >
>> > ami guru <dosto.walla@gmail.com> writes:
>> >> i am trying compile opengl program with  the shader support and i am
>> >> using
>> >> the opengl wrangler library for that.
>> >>
>> >>
>> >> I have subclassed the glwidget and included the glew header file before
>> >> the
>> >> inclusion of QGLWidget
>> >
>> > Segregate the two.  Use one file/class to handle the Qt side of things
>> > (event handling, slots, etc.).  In the implementation of that class,
>> > call functions defined in a separate compilation unit.  In the second
>> > unit, don't include any Qt stuff -- make sure it's only OpenGL calls.
>> >
>> > This is how we handle it with at least one project I work on.  There's
>> > probably a way to get them both to coexist peacefully, but I consider
>> > the above to be a better design anyway.
>> >
>> > HTH,
>> >
>> > -tom
>> >
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Open Source Business Conference (OSBC), March 24-25, 2009, San
>> > Francisco, CA
>> > -OSBC tackles the biggest issue in open source: Open Sourcing the
>> > Enterprise
>> > -Strategies to boost innovation and cut costs with open source
>> > participation
>> > -Receive a $600 discount off the registration fee with the source code:
>> > SFAD
>> > http://p.sf.net/sfu/XcvMzF8H
>> > _______________________________________________
>> > glew-users mailing list
>> > glew-users@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/glew-users
>> >
>> >
>
>