This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Method for finding reason behind "error: `obj' has incomplete type"
- From: Ian Lance Taylor <ian at airs dot com>
- To: Stephen torri <storri at torri dot org>
- Cc: gcc help <gcc-help at gcc dot gnu dot org>
- Date: 26 Jan 2005 21:26:13 -0500
- Subject: Re: Method for finding reason behind "error: `obj' has incomplete type"
- References: <1106792072.10558.22.camel@base.torri.org>
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