Method for finding reason behind "error: `obj' has incomplete type"

Ian Lance Taylor ian@airs.com
Thu Jan 27 02:26:00 GMT 2005


Stephen torri <storri@torri.org> writes:

> ../../src/data_source/File_Data_Transfer_T.cpp:78: error: `obj' has
> incomplete type
> ../../src/data_source/File_Data_Transfer_T.cpp:78: error: storage size
> of `obj' isn't known

The error means that you are trying to create an object (named 'obj')
but you are using a type which you have not fully defined.  The
compiler does not know how large the object should be.

> 	typename Data_Type::worker_type obj (new Data_Type());

I don't know what Data_Type is, but it appears that it is not fully
defined.  For example, you might just have "class Data_Type;" without
any definition of the class.

> Is there a compiler flag that I should use?

No.  You need to fix your program.

Ian



More information about the Gcc-help mailing list