When you try and compile some code and you get an error along the lines of invalid use of an incomplete type ‘whatever type’ then in most cases it means you need to include the header file where that type is displayed.
For example I had the following events in my header file:
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
When when I tried to compile gave the following error:
invalid use of incomplete type ‘struct QGraphicsSceneMouseEvent’
This was because the compiler could not find details of the struct and hence the details. To fix the problem I need to include the header.
This of course is similar to the initialized but not complete error but subtly different.
Similar posts to check out:
- May 19, 2012 -- Metro Apps in C++ anyone? (0)
In Visual Studio “11” when I try and create a new C++ Metro app using the built-in template, I get the following error: “Can’t find localized resources”. I wonder if anyone else has managed to get around this? I am running the Consumer Preview Build of Win 8 (Build 8250). ... - April 14, 2012 -- AWS Extension for Visual Studio (0)
I had forgotten that I had the AWS Extension for Visual Studio installed until recently I noticed AWS Explorer item in the View menu option. This add-in allows you to explore the various features that Amazon exposes right from within Visual Studio. The toolkit makes it easier for developers to debug and deploy a .NET solutions that uses AWS. When you install this, you also get AWS SDK for .NET which provides one with all the building blocks that are required for consuming the IaaS services ex... - May 26, 2011 -- Troubleshooting WCF Performance – Part 1 (0)
More related details on Dustin's post - WCF scales up slowly with bursts of work....
Tags: .code
April 28th, 2010 3:03 pm
[...] This post was mentioned on Twitter by Amit Bahree. Amit Bahree said: invalid use of incomplete type ‘blah’: When you try and compile some code and you get an error along the lines of … http://bit.ly/a5iK7n [...]