[omniORB] CORBA.h and std::min collision in VC++ 7.1

Vladislav Vrtunski vladislav.vrtunski at dmsgroup.co.yu
Tue Mar 13 13:00:16 GMT 2007


Stefan Wegele wrote, On 3/13/2007 10:02 AM:
>
> Hello,
>
>  
>
> I have a problem using std::min and a corba object in the same file.
> Here is the example:
>
>  
>
> #include <iostream>
>
> #include <omniORB4/CORBA.h>
>
> int main(int argc, _TCHAR* argv[])
>
> {
>
>       long a=23, b=345;
>
>       long c = std::min(a, b);
>
>       std::cout << c << std::endl;
>
>       return 0;
>
> }
>
>  
>
> I get:
>
> error C2589: '(' : illegal token on right side of '::'
>
> error C2059: syntax error : '::'
>
> for the line with std::min.
>
> If I remove the include of Corba.h then it works perfectly.
>
>  
>
> I declared: __WIN32__,__x86__,_WIN32_WINNT=0x0400, __NT__ and
> __OSVERSION__=4
>
> VC++ version: 7.1.6
>
>  
>
> Thanks, Stefan
>

Sounds like you have a macro definition of min somewhere in the headers
included by CORBA.h. Try
#undef min
bellow the
#include <omniORB4/CORBA.h>
line.

I think that this is a known problem on Win32. Take a look at this link:
http://www.devx.com/tips/Tip/14540

Regards,

Vladislav




More information about the omniORB-list mailing list