COIN-OR::LEMON - Graph Library

Opened 9 years ago

Closed 9 years ago

#595 closed defect (fixed)

MinGW (codeblocks) compilation problem

Reported by: Alpar Juttner Owned by: Alpar Juttner
Priority: critical Milestone: LEMON 1.4 release
Component: core Version: hg main
Keywords: Cc:
Revision id:


We use WIN32 define at several places in order to check the underlying macro. This however does not work with (at least recent versions of) MinGW and CodeBlocks, because it does node define WIN32.

This link indicates that this is actually the expected behaviour. The compiler normally defines _WIN32.

What shall we do? I can imagine the following resolutions.

  1. Replace WIN32 to _WIN32 everywhere in the code
  2. Put something like
    #ifdef _WIN32
    #ifndef WIN32
    #define WIN32

into core.h

  1. Have the platform checked by CMAKE and put the WIN32 define conditionally to lemon/config.h (generated from lemon/

We may define LEMON_WIN32 instead of WIN32.

Which option do you prefer?

Change History (1)

comment:1 Changed 9 years ago by Alpar Juttner

Resolution: fixed
Status: newclosed

Two changesets has been merged to branches 1.3 and default:

  • [f70f688d9ef9] resolves the problem above - on WIN32 environments lemon/ defines LEMON_WIN32 and this define is used to check the platform throughout the library.
  • [c199e9976d93] ignores warnings with VS and MinGW. Now LEMON compiles with them on Windows even in Maintainer mode.
Note: See TracTickets for help on using tickets.