Skip to main content
gamedev.net
🔒 Locked

Weird Dev C++ class/struct errors

Started by Rebooted 1 reply 700+ views
Original Post
Rebooted
Rebooted
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;
  	system("PAUSE");	
  	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;	
}MyStruct;
 
Am I missing something? Like I said, it works fine in VC++.
Rebooted
Rebooted
Woops stupid error. I had to define the struct before the class. Really sorry.
Deranged
Deranged
edit: ok nevermind my post then
[Mercury Software] [Google!] [ Look I DONT Follow Trends ]

[edited by - DerAngeD on January 23, 2004 5:31:17 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.