问题
I can't figure this one out. I can download a win32 binary of flex 2.5.4a from gnuwin32, but I'd like to build the latest version (2.5.35) using Visual Studio 2005. I suppose I could build in in cygwin, but where is the fun in that?
回答1:
Note that Flex is seriously out-of-date on Windows when it comes to generating C++ scanners. Recent Flex versions which are able to generate ISO C++ scanners do not support Win32 (MinGW or VS), so you're probably better of trying to generate a C scanner and call it from C++.
回答2:
since nobody provided a satisfactory answer to my question, i am posting my final solution here.
i was unable to find a way to build flex in vs 2005 or vs 2008. instead, i am using the flex that is distributed with cygwin, which is pretty recent. in order to save myself the hassle of installing cygwin on every machine that i need to use flex on, i just saved off the dependencies: cygwin1.dll and cygintl-8.dll.
there is only one caveat - cygwin's flex also depends on m4, though you won't see it on the dependency walker. it needs to be in the path, which makes it a pain. you can use cygwin's m4.exe, but it depends on cygwin1.dll also, which will need to be in the path for m4 to execute.
even so, i just check all of those files into my svn under a tools folder and then whenever i need to develop on another machine, get my code and flex with svn, copy m4.exe and cygwin1.dll to the windows\system32 folder, and i'm in business.
回答3:
You can also download the MINGW (Minimalist GNU for Windows) build of flex 2.5.35 at sourceforge.net. This build may not be entirely self-contained; the release notes suggest that certain components of MSYS (Minimal SYSytem) are required.
回答4:
Why you don't want to try the Spirit framework from Boost?
来源:https://stackoverflow.com/questions/226820/how-do-you-compile-flex-in-visual-studio-2005-2008