Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » problem with structure in .h file(compilation error)
problem with structure in .h file [message #782450] Mon, 23 January 2012 18:10 Go to next message
Paul Gordon is currently offline Paul GordonFriend
Messages: 5
Registered: January 2012
Junior Member
I am running eclipse version 20090920 and have a structure defined in the header1.h file and have this file included in a second header file. For some reason when I try to use the structure in the second header file, see below.

private: nameofstruct samestruct;//trying to create a private copy of structure


I get the compilation error, does not name a type for nameofstruct that is defined in the first header file.

in header1.h file I have

typedef struct {
int a;
}nameofstruct;

in header 2 file I have include header1.h above the class definition.

private: nameofstruct samestruct;//trying to create a private copy of structure nameofstruct called samestruct.

I get the error nameofstruct does not name a type in the line above.

any ideas, thanks?


Re: problem with structure in .h file [message #782556 is a reply to message #782450] Mon, 23 January 2012 23:53 Go to previous message
Paul Gordon is currently offline Paul GordonFriend
Messages: 5
Registered: January 2012
Junior Member
I am trying to use the same structure in multiple threads so guessing this is causing the issue, will look for data sharing between classes.
Previous Topic:source with file.dat
Next Topic:Similarities between CDT and J(ava)DT? Maven usage? Recommended Repository?
Goto Forum:
  


Current Time: Fri Apr 19 17:00:48 GMT 2024

Powered by FUDForum. Page generated in 0.03350 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top