[Qt-interest] Fwd: Fwd: Fwd: Fwd: Fwd: Fwd: qmake and staticlibissue
Scott Aron Bloom
Scott.Bloom at sabgroup.com
Tue Apr 21 20:57:46 CEST 2009
Check to make sure the guard is correct in the header file.
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of ami guru
Sent: Tuesday, April 21, 2009 11:54 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Fwd: Fwd: Fwd: Fwd: Fwd: Fwd: qmake and
staticlibissue
The error is as follows:
Is starts with the instantiation of the GLRender object.
And by the way which file inclusion you found that i did twice
In the header file i have declared as
class GLRender
And in the source file i did:
#include "GLRender.h"
Regards
Sajjad
**********************************'
GLWidget.cpp: In member function 'void GLWidget::RenderWithGL()':
GLWidget.cpp:278: error: invalid use of incomplete type 'struct
GLRender'
GLWidget.h:17: error: forward declaration of 'struct GLRender'
GLWidget.cpp:282: error: invalid use of incomplete type 'struct
GLRender'
GLWidget.h:17: error: forward declaration of 'struct GLRender'
GLWidget.cpp:288: error: invalid use of incomplete type 'struct
GLRender'
GLWidget.h:17: error: forward declaration of 'struct GLRender'
GLWidget.cpp:291: error: invalid use of incomplete type 'struct
GLRender'
GLWidget.h:17: error: forward declaration of 'struct GLRender'
GLWidget.cpp:292: error: invalid use of incomplete type 'struct
GLRender'
GLWidget.h:17: error: forward declaration of 'struct GLRender'
GLWidget.cpp:297: error: invalid use of incomplete type 'struct
GLRender'
GLWidget.h:17: error: forward declaration of 'struct GLRender'
GLWidget.cpp:300: error: invalid use of incomplete type 'struct
GLRender'
GLWidget.h:17: error: forward declaration of 'struct GLRender'
**********************************
---------- Forwarded message ----------
From: Scott Aron Bloom <Scott.Bloom at sabgroup.com>
Date: Tue, Apr 21, 2009 at 8:35 PM
Subject: Re: [Qt-interest] Fwd: Fwd: Fwd: Fwd: Fwd: qmake and staticlib
issue
To: qt-interest at trolltech.com
BTW... you included the header file twice...
What is the compiler saying exactly.. for what line? And show the line
of code...
Scott
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of ami guru
Sent: Tuesday, April 21, 2009 11:16 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Fwd: Fwd: Fwd: Fwd: Fwd: qmake and staticlib
issue
Hello Scott,
I have included both the header and the source file.
"BTW.. in general, I find it VERY poor practice to rely on predeclare
inside C++ files." - did you mean that it is not good practice
to have forward declaration in the header files?
Sajjad
---------- Forwarded message ----------
From: Scott Aron Bloom <Scott.Bloom at sabgroup.com>
Date: Tue, Apr 21, 2009 at 7:59 PM
Subject: RE: [Qt-interest] Fwd: Fwd: Fwd: Fwd: qmake and staticlib issue
To: ami guru <dosto.walla at gmail.com>, qt-interest at trolltech.com
Looking at your header...
You need to predeclare the following:
Light
Material
ViewableBase
GLRender
In your C++ file... you need to have defined
glDraw (GLRender)
Whatever MainView is
Light
And ViewableBase
But unless you provide a reproducalbe example of the code... I cant work
on it any further...
Ie, an actual CPP and Header file... What your showing is almost
worthless because I cant "try" to compile it and see the same error.
BTW.. in general, I find it VERY poor practice to rely on predeclare
inside C++ files.
Scott
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of ami guru
Sent: Tuesday, April 21, 2009 10:53 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Fwd: Fwd: Fwd: Fwd: qmake and staticlib issue
The following snippet where the errors shows up from:
****************GLWidget.h***************
//do the forward
//declaration instead
class CameraView;
class GLRender;
class PixelArray;
int NumLights;
// Array of light pointers
Light* LightArray[MAX_LIGHTS];
int NumMaterials; // Number of materials
//Array of material pointers.
Material* MatArray[MAX_MATERIALS];
int NumObjects; // Number of objects
ViewableBase* ViewObj[MAX_OBJECTS];// Array of viewable object
pointers
GLRender* glDraw;
**************************************'
***************GLWidget.cpp***********
#include "GLRender.h"
void GLWidget::RenderWithGL()
{
/*
if ( glDraw == 0 )
{
// Needs to be constructed *after* glut initialized.
glDraw = new GLRender();
}
// Set camera position
glDraw->SetupCameraView( *MainView, 1.0, MAX_DIST );
// Define all light sources
int i;
for ( i=0; i<NumLights; i++ )
{
glDraw->AddLight( *(LightArray[i]) );
}
glDraw->SetGlobalAmbientLight( GlobalAmbientR3 );
glDraw->SetGlobalAmbientLight( 0.5, 0.5, 0.5 );
// Render each ViewableObject
for ( i=0; i< NumObjects; i++ )
{
glDraw->RenderViewable( *(ViewObj[i]) );
}
glDraw->FinishRendering();
*/
}
the commented part gives error
*****************************************
Regards
Sajjad
---------- Forwarded message ----------
From: Scott Aron Bloom <Scott.Bloom at sabgroup.com>
Date: Tue, Apr 21, 2009 at 6:52 PM
Subject: Re: [Qt-interest] Fwd: Fwd: Fwd: qmake and staticlib issue
To: qt-interest at trolltech.com
Without seeing the code.. its hard to give a definitive answer...
However.. the compiler doesn't pick on people... ie, its not saying..
hmm lets mess with Sajjad, and give this error that is in theory good
code...
Show the line of code the compiler is complaining about, and we might be
able to figure out what is going on...
Maybe you have a return type? Maybe it's a non reference...
Don't know... But your theory is correct.. Mostly likely, your not
following it J
Scott
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of ami guru
Sent: Tuesday, April 21, 2009 6:50 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] Fwd: Fwd: Fwd: qmake and staticlib issue
If i forward declare a class then i only use the reference or pointer
for that class and we do not instantiate any object of that class.
That what the theory says and i have used that accordingly.
In the GLWidget.h clas i have used the forward declared a class named
GLRender since i am using the pointer of its type.
In thr GLWidget.cpp file i am creating a object of GLRender with the
new operator and there i have included the GLRender.h
It should not complain.
But it does.
Would like to know why?
Regards
Sajjad
---------- Forwarded message ----------
From: John McClurkin <jwm at nei.nih.gov>
Date: Tue, Apr 21, 2009 at 2:23 PM
Subject: Re: [Qt-interest] Fwd: Fwd: qmake and staticlib issue
To: qt-interest at trolltech.com
ami guru wrote:
> Hello Farid,
>
> Thanks a lot for the feedback.
>
> I have tried the absolute path instead of the relative one and it
works
> fine now.
>
>
> Now i have another error which i think will be off-topic to bring up
here.
>
>
> I am getting the error saying that
>
>
> invalid use of the incomplete type.
>
> When do we have these type of error?
This usually occurs when you forward declare a class but don't include
the header.
>
>
> Regards
> Sajjad
>
> On Mon, Apr 20, 2009 at 6:35 PM, Farid Derradji
> <farid.derradji at itwm.fraunhofer.de
> <mailto:farid.derradji at itwm.fraunhofer.de>> wrote:
>
> Hello Sajjad,
>
> Perhaps you should first check whether your compiled libraries
contain
> all required symbols (methods):
>
> objdump --demangle --syms libVrMath.a > libVrMath.txt
> objdump --demangle --syms libDataStructs.a >
libDataStructs.txt
> objdump --demangle --syms libOpenGLRender.a >
libOpenGLRender.txt
> objdump --demangle --syms libRaytraceMgr.a >
libRaytraceMgr.txt
> objdump --demangle --syms libGraphics.a > libGraphics.txt
>
> Hereby *objdump* is a pretty useful tool of the *binutils*
collection.
> Note that you need the debug versions of your libraries if you
want to
> use Option --syms.
>
>
> Regards
> Farid
>
>
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090421/655c389d/attachment.html
More information about the Qt-interest-old
mailing list