This topic is now archived and is closed to further replies.


Weird Dev C++ class/struct errors

Recommended Posts

I keep getting weird errors from Dev-C++ with code that works on MSVC. This is whats basicly happening:
struct MyStruct
	int MyInt;	

class MyClass
	MyStruct TheStruct;

int main(int argc, char *argv[])
	XXfile file;
  	return 0;
I get an "''MyStruct is used as a type, but not defined as a type error''", and only when i create the struct in a class. If I made one in the main function it would compile properly. I also tried using:
typedef struct _MyStruct
	int MyInt;	
Am I missing something? Like I said, it works fine in VC++.

Share this post

Link to post
Share on other sites