For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

regarding header files

Amitabh Tandon's picture
Forums: 

Hi ,

I apologize for reposting this help message but I am really facing problem with the inclusion of header files when I am creating my own sample application (I am creating a win32 dll which is internally calling open cascade funtions) .It seems to me the problem is coming when open cascade is calling internal macro's of window's such as this peice of code from Standard_math.hxx :

#ifdef WNT

# ifndef __MATH_WNT_H
# define __MATH_WNT_H

__Standard_API double __cdecl acosh ( double );
__Standard_API double __cdecl asinh ( double );
__Standard_API double __cdecl atanh ( double );

# define M_SQRT1_2 7.0710678118654752440E-1
# define M_PI_2 1.5707963267948966192E0

# endif /* __MATH_WNT_H */

#endif /* WNT */

where I am getting asinh as undefined

or

When Standard_Integer calls #define INT_MIN (-2147483647 - 1) /* minimum (signed) int value */ this statement from window's limits.h

where I am getting INT_MIN as undefined

I am sure there is a solution to this as the MFC sample dont seem to be having the same problem but I have gone through the settings in the MFC sample and I haven't been successful in finding a solution.

I would really appreciate some help on this.

With Regards,
Amitabh

Rob Bachrach's picture

Make sure you have WNT in the Preprocessor Definitions of your project settings. You will also see this in the MFC sample.

Amitabh Tandon's picture

Hi Rob ,

Thanks a lot it worked . I would appreciate it if you could tell me what is the significance of adding WNT to preprocessor . I have been trying to look for it on the net but was unable to find any good explanation .Also in the other environments such as linux how do I need to handle this.

With Regards,
Amitabh

Rob Bachrach's picture

I don't remember where I found out about these the first time, but OCC requires WNT to read the correct headers on Win32. In addition, I have CSFDB defined, although I don't remember why. Although I don't use Linux, I do use Solaris. My Solaris makefile defines HAVE_CONFIG_H to insure that OCC reads the config.h from the inc directory.

Sorry I can't be of more help.

Amitabh Tandon's picture

Thanks a lot Rob for the help .

If anybody knows any detailed information about WNT setting in
windows I would appreciate it if you could share it with me.

With Regards,
Amitabh

Stephane Routelous's picture

the reason of this preprocessor directive is because the OpenCASCADE code should compile on different plateforms.

in the code, you have something like

#ifdef WNT
//headers or code specific to windows
#elif IRIX
//headers or code specific to SGI IRIX
#endif

an example can be found in the OSD package, ex : OSD_SharedLibrary.cxx where you have :
#ifndef WNT
//unix compliant code
#else
//specific windows code
#endif

HTH,

Stephane
http://www.exotk.org

Amitabh Tandon's picture

Hi Stephane ,

Thanks for the input . Would you be knowing where the declaration of WNT happens and how is it used .That is it would be great if you could give me some more details specifically about WNT

With Regards,
Amitabh

Stephane Routelous's picture

you have to specify it as preprocessor directive in your VisualC++ project Settings.

Amitabh Tandon's picture

Hi Stephane ,

I had learnt that from Rob.What I wanted to know was how does VC++ treats it internally . When we specify WNT in the preprocessor setting what does VC++ do with it.Does it consider it as equivalent to having a #define WNT in one of the headers .(if I can put it like that)

With Regards,
Amitabh

With Regards,
Amitabh

Stephane Routelous's picture

it is like a global #define

Amitabh Tandon's picture

Thanks Stephane just wanted confirm that .Thanks a lot for the help

With Regards,
Amitabh

CONNECT WITH US

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.