Problem about initialize a mutex object in a class

Kun Niu haoniukun@gmail.com
Tue May 8 03:16:00 GMT 2007


Thank you for your reply.
In fact, I do have the semicolone in my code.:(

2007/5/7, jlh <jlh@gmx.ch>:
> Hello!
>
> Your class definition is missing the semicolon after the closing
> brace.  My g++-4.1.1 even warns about it:
>
> a.c:11: error: new types may not be defined in a return type
> a.c:11: note: (perhaps a semicolon is missing after the definition of 'Thread')
> a.c:11: error: return type specification for constructor invalid
>
> Because of the missing semicolon, the class is parsed as the
> return type of the following constructor, i.e., as in "int func()"
> it parses "class { } func()", and only later notices that
> constructors shouldn't have a return type.
>
> jlh
>


-- 
失业
         牛坤
MSN:haoniukun@hotmail.com


More information about the Gcc-help mailing list