LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-23-2005, 07:44 AM   #1
ChemicalBurn
LQ Newbie
 
Registered: Feb 2005
Posts: 28

Rep: Reputation: 15
Incomplete type


Im getting this error when I call a method from a class in the library Im using, and it assigns at one point a value to an object of type 'FiberEdgeType':

error: base class `FiberEdgeType' has incomplete type

Anyone know what this error means?
Sorry I didnt include much code, but I'd have to include massive blocks if I put all thats relevant.
Basically:

Code:
RelatedEdges<FiberEdge> _RelatedFiberEdges; //FiberEdge is a type definition of a template class.

and in 
class RelatedEdges
template<class EdgeTPointer> void RelatedEdges<EdgeTPointer>::ReadTwo(BasicIo* parser) { //The EdgeTPointer is in this case the object of type FiberEdgeType

....
                  EdgeTPointer n2 = 0;
                  n = Convert(vg->Id2Edge(id),n2); //Id2Edge returns an EdgeTPointer
//Here is where the error occurs
                 ...
...
}
Never seen this error before... Anyone?
 
Old 02-23-2005, 10:21 AM   #2
YetAnotherDave
Member
 
Registered: Feb 2005
Posts: 95

Rep: Reputation: 17
The error (probably) means that you need to include the file that defines FiberEdgeType .
 
Old 02-24-2005, 05:54 AM   #3
ChemicalBurn
LQ Newbie
 
Registered: Feb 2005
Posts: 28

Original Poster
Rep: Reputation: 15
Thanks!!
Excuse my ignorance, but HOW did that solve it? It recognized everything related to the object because I included the type definition. And why would it give "incompatible type" error, instead of a, for example, no definition for... found.
 
Old 02-24-2005, 08:32 AM   #4
YetAnotherDave
Member
 
Registered: Feb 2005
Posts: 95

Rep: Reputation: 17
Glad to have helped.

The "incomplete type" error generally means that the compiler knows something about a type but not enough to do what you want to do with it.

In this case FiberEdgeType was forward declared somewhere along the way - probaby in some other include file. The compiler knew that FiberEdgeType is a class but not the internal details. The code you posted did something that needs to know about the internal details of the class - probably just trying to access a member. At this point you got the "incomplete type" error. Including the full class definition before this point takes care of it.

- Dave
 
Old 02-24-2005, 08:44 AM   #5
ChemicalBurn
LQ Newbie
 
Registered: Feb 2005
Posts: 28

Original Poster
Rep: Reputation: 15
Thanks, appreciate the help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tai64nlocal.c:55: error: dereferencing pointer to incomplete type ExCIA Linux - General 1 03-31-2009 09:49 AM
redeferenced pointer to incomplete type Aldair1808 Programming 1 11-28-2005 03:23 PM
ereferencing pointer to incomplete type? ams Programming 5 03-03-2005 10:32 AM
arrays of elements with [gcc4]array type has incomplete element type lmmix Linux - Software 0 02-26-2005 08:07 AM
sem has incomplete type error in building the filesystem image sudhirvemana Linux - Newbie 1 11-25-2004 01:45 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration