[omniORB] Issue with defining a constant in idl

Obermaier, Stephen J [US] (TS) stephen.obermaier at ngc.com
Thu Sep 21 21:08:52 BST 2017


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20170921/dc6072e6/attachment.html>


More information about the omniORB-list mailing list