Hi,
I'm trying to use OpenSim & Simbody APIs with MFC (developing in VS 2010)
But there are some errors when using OpenSim APIs.
When I include OpenSim.h in my project file, error C2589 is occured.
It does not occured when I use win32 console application project.
So I also trying to build SimBody and OpenSim from sources,
but problem was not solved.
Is there any thing I should do for using OpenSim APIs with MFC?
Or, is there anyone who using OpenSim APIs with QT platform?
Thanks.
Using APIs with MFC
- Michael Sherman
- Posts: 812
- Joined: Fri Apr 01, 2005 6:05 pm
Re: Using APIs with MFC
Please provide detailed information about exactly what problem you are encountering. My guess is that a macro defined by one of the MFC headers is redefining a symbol that it is in use in OpenSim, but it is hard to tell without knowing precisely what the compiler is complaining about.
Sherm
Sherm
- YeongHun Kim
- Posts: 6
- Joined: Sun Apr 04, 2010 11:47 pm
Re: Using APIs with MFC
Thanks for your reply.
The message that [error c2589 '(' : illegal token on right side of ':: '] is occured
when I trying to use OpenSim headers with MFC.
Detail messages are like this.
The message that [error c2589 '(' : illegal token on right side of ':: '] is occured
when I trying to use OpenSim headers with MFC.
Detail messages are like this.
1>c:\simbody\build\include\SimTKcommon/internal/NTraits.h(323): error C2589: '(' : '::' 오른쪽에 잘못된 토큰이 있습니다.
1>c:\simbody\build\include\SimTKcommon/internal/NTraits.h(323): error C2059: 구문 오류 : '::'
1>c:\simbody\build\include\SimTKcommon/internal/NTraits.h(323): error C2589: '(' : '::' 오른쪽에 잘못된 토큰이 있습니다.
1>c:\simbody\build\include\SimTKcommon/internal/NTraits.h(323): error C2589: '(' : '::' 오른쪽에 잘못된 토큰이 있습니다.
1>c:\simbody\build\include\SimTKcommon/internal/NTraits.h(329): error C2589: '(' : '::' 오른쪽에 잘못된 토큰이 있습니다.
1>c:\simbody\build\include\SimTKcommon/internal/NTraits.h(329): error C2059: 구문 오류 : '::'
1>c:\simbody\build\include\SimTKcommon/internal/NTraits.h(329): error C2589: '(' : '::' 오른쪽에 잘못된 토큰이 있습니다.
1>c:\simbody\build\include\SimTKcommon/internal/NTraits.h(329): error C2589: '(' : '::' 오른쪽에 잘못된 토큰이 있습니다.
1>c:\simbody\build\include\SimTKcommon/internal/NTraits.h(335): error C2589: '(' : '::' 오른쪽에 잘못된 토큰이 있습니다.
1>c:\simbody\build\include\SimTKcommon/internal/NTraits.h(335): error C2059: 구문 오류 : '::'
- Michael Sherman
- Posts: 812
- Joined: Fri Apr 01, 2005 6:05 pm
Re: Using APIs with MFC
Thanks -- it looks like those are complaints about calls to the C++ standard library function std::max(). That is likely because Microsoft foolishly includes max (and min) macros in some Windows headers. Microsoft provides some advice here: http://support.microsoft.com/kb/143208. Basically you can prevent the definition of those macros by preceding your first Windows include with
Regards,
Sherm
Code: Select all
#define NOMINMAX
Sherm
- YeongHun Kim
- Posts: 6
- Joined: Sun Apr 04, 2010 11:47 pm
Re: Using APIs with MFC
Thanks, Sherman~!
I solve the problem by using your suggested method.
(Actually there are some problems remains using with MFC,
but with win32 dialog, using #define NOMINMAX solve the problem.)
best regards,
Yeonghun Kim
I solve the problem by using your suggested method.
(Actually there are some problems remains using with MFC,
but with win32 dialog, using #define NOMINMAX solve the problem.)
best regards,
Yeonghun Kim