473,324 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Error:Incomplete type and not allowed(Problem in returning structurevariable)

Hi all.

I am writing a a code in c++ . i have defined a global structure in a
header file(user define header file) say headerfile1.h and declared a
class in file2.h which is having some public funtion which returns the
struct variable and definition of the fun in in file1.cpp .
I am getting the error in compilation that "struct_var' has
incomplete type and not allowed and return type is incoplete. If i am
trying to return the structure pointer instead of variable it is
compiling without error but returning structure variable is creating
problem.

Kindly help to solve the problem.

Thanx in advance
Nov 16 '07 #1
4 5996
On Nov 15, 9:53 pm, sharat <aaliya.zar...@gmail.comwrote:
Hi all.

I am writing a a code in c++ . i have defined a global structure in a
header file(user define header file) say headerfile1.h and declared a
class in file2.h which is having some public funtion which returns the
struct variable and definition of the fun in in file1.cpp .
I am getting the error in compilation that "struct_var' has
incomplete type and not allowed and return type is incoplete. If i am
trying to return the structure pointer instead of variable it is
compiling without error but returning structure variable is creating
problem.

Kindly help to solve the problem.

Thanx in advance

It sounds like you haven't included headerfile1 in file2.h or
at least in the .cpp file. If that doesn't help post the
code here.

Brian Wood
Ebenezer Enterprises
www.webebenezer.net
Nov 16 '07 #2

i have included the header file . actually file is included in main .
For my project i am having one header file which contatins all the
global structures to be used in the code ,all other .h and .cpp files
uses these structures. If i am including comman header file in each
(other different) header files it is giving redefinition
error.Including in main is not solving the purpose. I can extern the
structure and use in the perticular class which i want but i want some
other method then extern . if unable to get the problem i'll post the
code but i think this solve the purpose . Kindly help .thanx in
advance .
Nov 16 '07 #3
i have included the header file . actually file is included in main .
For my project i am having one header file which contatins all the
global structures to be used in the code ,all other .h and .cpp files
uses these structures. If i am including comman header file in each
(other different) header files it is giving redefinition
error.Including in main is not solving the purpose. I can extern the
structure and use in the perticular class which i want but i want some
other method then extern . if unable to get the problem i'll post the
code but i think this solve the purpose . Kindly help .thanx in
advance .
Nov 16 '07 #4
"sharat" <aa***********@gmail.comwrote in message
news:c0**********************************@s8g2000p rg.googlegroups.com...
>
i have included the header file . actually file is included in main .
For my project i am having one header file which contatins all the
global structures to be used in the code ,all other .h and .cpp files
uses these structures. If i am including comman header file in each
(other different) header files it is giving redefinition
error.Including in main is not solving the purpose. I can extern the
structure and use in the perticular class which i want but i want some
other method then extern . if unable to get the problem i'll post the
code but i think this solve the purpose . Kindly help .thanx in
advance .
quote "... If that doesn't help post the code here."

Nov 16 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: toufik toufik | last post by:
I'm using the errorHandler function (http://www.zend.com/zend/spotlight/error.php) to manage error handling in my code, the problem is that in all the tests that I did the error type is always...
4
by: Anand Pillai | last post by:
Hi I am quite familiar with normal python errors which can be caught by using the try... except... finally clause. But very often I find other kinds of exceptions raised in my programs. Here...
2
by: Iona | last post by:
Does anyone know this type of error means? Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) Could not use ''(unknown)''; file already in use. /asp/PPLMain/memberpage.asp, line...
0
by: Harald Hoyer | last post by:
My application has an exe and some DLLs. During debugging only debug information of the current binary is available. For example: ============DLL: ...
2
by: Anthony Borla | last post by:
Greetings, I hope everyone is enjoying the Holiday Season :) ! I'm attempting to implement a function template modelled somewhat on the STL's, 'generate' and 'generate_n' algorithms. Now,...
6
by: Si | last post by:
I get the following error from the code below: Error Type: (0x80020009) Exception occurred. /diary.asp, line 53 The specific part that causes the exception is when I try to access...
0
by: Jim | last post by:
Can anyone think why Im getting the following message when I try to write to an XML fill using IIS but when I upload it to my web server it writes no problem? I've enabled write acces to the XML...
2
by: Kevin G. | last post by:
I am trying to instantiate an in-house DLL within my ASP application and I'm getting the following error: Error Type: Server object, ASP 0177 (0x800AEA5F) 800aea5f I have tried...
1
by: Kimmo Laine | last post by:
Hi! We've encountered a strange problem concerning memory usage. In the previous install the maximum memory amount per page was limited to 8 MB and it was never reached. Now, after upgrading...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.