[Lemon-user] LEMON with windows.h
Péter Kovács
kpeter at inf.elte.hu
Mon Jul 16 16:17:10 CEST 2018
Hi Szabolcs,
thanks for reporting the issue and sorry for the late answer.
I created a bug report from your email and also suggested another
solution. Please check it here:
http://lemon.cs.elte.hu/trac/lemon/ticket/612
Regards,
Péter
On 2018-06-14 11:56, Szabolcs Horvát wrote:
> Hello Lemon users,
>
> The following problem caused me a lot of frustration, so I thought I'd
> share the solution with the rest of you.
>
> I had some working LEMON-based code that I wrote on OS X, but then
> couldn't compile on Windows due to a few mysterious errors that seemed
> to come from the LEMON headers and not my own code.
>
> The problem turned out to be that I was using LEMON in conjunction
> with a C library, which in turn includes <windows.h> on Windows
> (obviously not on OS X), which in turn defines the macros IN and OUT.
> LEMON uses these same names as template parameters, hence the errors.
>
> A simple
>
> #undef IN
> #undef OUT
>
> before including any LEMON headers will fix the problem. Doing this
> appears to be completely safe (perhaps LEMON could do it by default):
>
> https://stackoverflow.com/questions/35907493/in-and-out-macros-in-minwindef-h
>
> Szabolcs
> _______________________________________________
> Lemon-user mailing list
> Lemon-user at lemon.cs.elte.hu
> http://lemon.cs.elte.hu/mailman/listinfo/lemon-user
More information about the Lemon-user
mailing list