Error in class declaration

Post Reply
zangai
Posts: 2
Joined: Fri Dec 18, 2009 3:45 pm

Error in class declaration

Post by zangai » Fri Dec 18, 2009 3:58 pm

I am currently working on a application for the Nintendo DS. I got this header file:

line.h

Code: Select all

class CLine
{
public:

	int pos;
	bool vert;
	int speed;
	unsigned short color;

	CLine(void);
	~CLine(void);
	void draw();
	void clear();
};
But when compiling it, I get the following error:

Code: Select all

Line.h(1): error: expected '=', ',', ';', 'asm' or '__attribute__' before 'CLine'
Is this because normal class declaration is not supported on DevKitARM? Or what am I doing wrong?

Thanks in advance.

User avatar
Izhido
Posts: 107
Joined: Fri Oct 19, 2007 10:57 pm
Location: Costa Rica
Contact:

Re: Error in class declaration

Post by Izhido » Fri Dec 18, 2009 4:23 pm

Be sure your .cpp files have a .cpp extension, instead of .c . The standard makefile(s) of the toolchain decide which compiler (C or C++) to use based on the extension of the files you're giving to it.

zangai
Posts: 2
Joined: Fri Dec 18, 2009 3:45 pm

Re: Error in class declaration

Post by zangai » Fri Dec 18, 2009 5:20 pm

I changed the main.c to main.cpp, cleaned my project, rebuild it, and it worked!

Thank you :)

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 6 guests