This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: During building some code I get "... should have been declared inside ..."


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]