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 26, 2011 -- Troubleshooting WCF Performance – Part 1 (0)
More related details on Dustin's post - WCF scales up slowly with bursts of work.... - May 23, 2011 -- PowerShell script to kill named processes (0)
There are times when you need to kill a number of processes in one-go like today when Chrome crashed a few times hanging all the running instances – next time Google says, one tab cannot bring down all of them – send them my way :). For such times, a PowerShell script is all you need.
I wrote up a simple one which takes the process name as input and then kills all the processes which match that name.
[sourcecode lang="PowerShell" toolbar="true"]
#Script is not signed, so need this.
Set-... - March 4, 2011 -- Twitter Trends (0)
I was excited to find that Twitter had a JSON (Javascript Object Notation) endpoint for the current trending topics and decided to write a simple consumer which can read this and then spit it out in a simple console. And JSON being so simple and more or less “universal” meant that there are multiple implementations for .NET. Of course if you got lots of bandwidth you can roll out your own parser.
I ended up using Json.NET, which in addition to being OpenSource is also one of the most robust u...
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 [...]