If FMILIB_BUILD_LEX_AND_PARSER_FILES is set in the cmake build, the resulting generated sources has to be modified by hand. Lines containing the following content: #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif needs to be updated to: #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #else /*windows compatibility case*/ #include #define isatty _isatty #define fileno _fileno #endif