Search code examples
cvisual-studio-2008visual-studio-2005flex-lexer

How do you compile flex in Visual Studio 2005/2008?


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?


Solution

  • 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.