This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: During building some code I get "... should have been declared inside ..."
- From: Axel Freyn <axel-freyn at gmx dot de>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 20 Oct 2009 12:22:59 +0200
- Subject: Re: During building some code I get "... should have been declared inside ..."
- References: <6e1a16e50910200246g31d9e052v40df1a5c4e90ac73@mail.gmail.com> <6e1a16e50910200305o5b6fc9b3s635a9980956e3dd7@mail.gmail.com>
Hi Adrian
>
> I get some code, I'm able to build this code on gcc412 without any
> errors (debian4 x86_64), but when I try build the same code on gcc432
> (debian 5 x86_64) I get:
>
> ServiceConfiguration.cxx:39:Â error: âvoid* glite::config::service_main(
> void*)â should have been declared inside âglite::configâ.
>
> The problem is that I cant not force developers to improves this code
> because they are support only SLC5 (with gcc412) :(
I fear that's the only possibility: the code is no valid C++, gcc-4.1
did accept it, later versions don't do it anymore: You are not allowed
to define a function inside a namespace outside the namespace :-)
void *glite::config::service_main(void * data);
is invalid, you need instead
namespace glite{
namespace config{
void *service_main(void * data);
}
}
At least to my knowledge there is nothing else you can do:-(
> This softvare org.glite.data.config-service could be downloadedÂÂ from:
>
> cvs -d :pserver:anonymous@glite.cvs.cern.ch:/cvs/glite co -r
> glite-data-config-service_R_2_4_0_1 org.glite.data.config-service
Axel