- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a small program written for Linux and OSX which I need to compile for Windows. The problem is simple. I have a class defining a member-function "min". When I try to compile it under windows, I get
warning #945: type qualifier ignored
inline const Label2D& min(const Label2D &other)
and
error: inline specifier allowed on function declarations only
inline const Label2D& min(const Label2D &other)
and some more which all point to the fact that "min" is already defined as macro. The question is: When does this happen and is there a way to turn it off?
I'm not using any "using namespace std;" directives inside the code and this error never occured on OSX or Linux. Compiler switches in Windows are:
"/c /O2 /Ob2 /Ehsc /MD /GS /fp:fast /W1 /TP /Zm1000 /Qparallel /Qtbb /Qopenmp" and some includes and defines like "WIN32". any ideas?
Cheers Patrick
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi again,
I found it. It seems that defining NOMINMAX solves the problem. I didn't use any windows header and was confused where this came from..
Cheers
Patrick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page