Issue with defining a constant in idl

"Obermaier, Stephen J \[US\] \(TS\) via omniORB-list" <[email protected]>
Newsgroups gmane.comp.corba.omniorb.user
Message-ID <[email protected]>
Hello -



I'm running into a compilation issue when I define a constant in an idl file.



If, for example I define in idl:



const short ELEMENT_SIZE = 6;



this generates the following source in the header file:



static _core_attr const ::CORBA::Short ELEMENT_SIZE _init_in_cldecl_( = 6 );



But the idl compiler also places the same code in the .cpp file.  This results in a linker error (MS LNK2005, already defined).



I can work around this by simply commenting out the duplicate definition in the cpp file, but this is obviously not a very viable solution.



Is there a better workaround to this?



Thanks,



Steve Obermaier

_______________________________________________
omniORB-list mailing list
[email protected]
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.