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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxx:/cvs/glite co -r
> glite-data-config-service_R_2_4_0_1 org.glite.data.config-service

Axel

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux