[omniORB] Problems with const in MSVC. Bug?

Pep Turro jturro@ac.upc.es
Fri, 05 Mar 1999 12:56:08 +0100


Hi,

Environment: Win95, Visual C++ 6.0, OmniORB 2.7.0 (win32 bin dist)

Visual C++ complains about generated code for IDL 'const'. E.g. if you
modify the "echo" example:

interface Echo {
  const short mesg_max_len = 16;
  string echoString(in string mesg);
}

and try to compile the example, you get:

C:\omniORB_2.7.0\src\examples\echo>nmake /f dir.mak

        ..\..\..\bin\x86_win32\omniidl2 -a -t -h .hh -s SK.cc echo.idl
echo.idl
        cl /nologo /c -O2 -MD -GX -D__WIN32__ -D__x86__ -D__NT__
-D__OSVERSION__=4 -I. -I..\..\..\include /TpechoSK.cc 
echoSK.cc
..\..\..\include\omniORB2/omniInternal.h(132) : warning C4518:
'__declspec(dllimport ) ' : storage-class or type specifier(s)
unexpected here; ignored
echo.hh(49) : error C2258: illegal pure syntax, must be '= 0'
echo.hh(49) : error C2252: 'mesg_max_len' : pure specifier can only be
specified for functions
echoSK.cc(7) : error C2039: 'mesg_max_len' : is not a member of 'Echo'
        echo.hh(46) : see declaration of 'Echo'
echoSK.cc(7) : error C2734: 'mesg_max_len' : const object must be
initialized if not extern
NMAKE : fatal error U1077: 'C:\ARCHIV~1\MICROS~2\VC98\BIN\cl.exe' :
return code
'0x2'
Stop.


Is this a bug in omniidl2? Or in VC6.0?

Thanks,

Pep.