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

Stefan Naewe stefan.naewe at atlas.de
Tue Mar 13 12:32:36 GMT 2007


Dominguez, Jose Luis schrieb:

>> 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
>>

> 
> try using namespace std instead of std::
> 

What difference should that make?

I'd try including the correct header:

#include <algorithm>


Stefan
-- 
----------------------------------------------------------------------
Dipl.-Inform. Stefan Naewe                       ATLAS Elektronik GmbH
                                                         Dept.: NUS T4
phone: +49-(0)421-457-1378                Sebaldsbruecker Heerstr. 235
fax:   +49-(0)421-457-3913                                28305 Bremen



More information about the omniORB-list mailing list