Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » syntax error after including class definition
syntax error after including class definition [message #235038] Mon, 22 June 2009 09:15 Go to next message
alex lauter is currently offline alex lauterFriend
Messages: 15
Registered: July 2009
Junior Member
Hi,

I am using eclipse platform Version: 3.4.2 Build id: M20090211-1700
together with cdt 5.0.2 and gcc compiler.

I define a class "PrintUtil.h" and build the project. Everything is ok.
I include the header file of the class in main program and build the
project. Now I get syntax error in the header file of the class

..\src\PrintUtil.h:11: error: syntax error before "PrintUtil"
..\src\PrintUtil.h:11: error: syntax error before '{' token

Hier is the code for the class header file "PrintUtil.h"

#ifndef PRINTUTIL_H_
#define PRINTUTIL_H_

class PrintUtil {
public:
void getApplicationInformation()
{
printf("rns version 2.1");
}
};

#endif /* PRINTUTIL_H_ */
Re: syntax error after including class definition [message #235063 is a reply to message #235038] Mon, 22 June 2009 19:49 Go to previous messageGo to next message
Patrick Schmitt is currently offline Patrick SchmittFriend
Messages: 87
Registered: July 2009
Member
You should learn C++, its a compiler issue ;)

alu schrieb:
> Hi,
>
> I am using eclipse platform Version: 3.4.2 Build id: M20090211-1700
> together with cdt 5.0.2 and gcc compiler.
>
> I define a class "PrintUtil.h" and build the project. Everything is ok.
> I include the header file of the class in main program and build the
> project. Now I get syntax error in the header file of the class
>
> .\src\PrintUtil.h:11: error: syntax error before "PrintUtil"
> .\src\PrintUtil.h:11: error: syntax error before '{' token
>
> Hier is the code for the class header file "PrintUtil.h"
>
> #ifndef PRINTUTIL_H_
> #define PRINTUTIL_H_
>
> class PrintUtil {
> public:
> void getApplicationInformation()
> {
> printf("rns version 2.1");
> }
> };
>
> #endif /* PRINTUTIL_H_ */
>
>
Re: syntax error after including class definition [message #837286 is a reply to message #235063] Thu, 05 April 2012 13:34 Go to previous message
scorpdaddy Missing name is currently offline scorpdaddy Missing nameFriend
Messages: 2
Registered: June 2011
Junior Member
This answer is really unhelpful. Just ran into the same issue above.
Previous Topic:Expressions not always updating
Next Topic:How to set project defaults
Goto Forum:
  


Current Time: Sat Apr 20 04:00:41 GMT 2024

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

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

Back to the top