Using OpenCascade with gcc compiler

I was trying to make OpenCascade's object Graphic3d_WNTGraphicDevice but gcc compiler have sent error message "ISO C++ forbid" at file IntefaceGraphic_WNT.hxx line with:
__declspec( dllimport ) InterfaceGraphic_RealizePalette ( HDC, HPALETTE, BOOL, BOOL );
Obviosly, or I'm just supposing, these are MS compiler specific C++ extensions for managing DLLs.
How to solve this problem with gcc compiler?

ebrusic's picture

I forgot to mention that it I was compiling on MS - Windows 2000 platform using wxWindows gui toolkit.

m-aronsson's picture

Hi !

What do you mean with gcc compiler ?, are you using a gcc compiler on the win32 platform (MinGW, cygwin...) or do you want to compile OCC on a unix OS ?

The win32 specific stuff should not be compiled on unix of course so in that case some #define is missing, if you are using MinGW for example then the __declspec works just fine, it will compile them without any problems.

Mikael

ebrusic's picture

Thanks Mikael for helping.
It is MinGW compiler using on DevC++ IDE.
As I mention, when I put this code on initializing Win app:
try
{myGraphicDevice = new Graphic3d_WNTGraphicDevice();} ....
I received that message on header InterfaceGraphic_WNT.hxx :
"ISO C++ forbids"

Perhaps some #define are missing as you said?
I put only #define for using wxWindows, nothing for OpenCascade.
Thanks again.

ebrusic's picture

As more info here is compile log:
D:/OpenCascade5.0/5.0/ros/inc/InterfaceGraphic_WNT.hxx:56: ISO C++ forbids
declaration of `InterfaceGraphic_RealizePalette' with no type

make.exe: *** [base.o] Error 1