Hi all,
I know it is a very old thread but I used it to implement my bison/flex parser with Qt, at least I tried.

I wrote a .pro file:

Qt Code:
  1. # Flex/bison specifics
  2. FLEXSOURCES = VHDLParser.l
  3. BISONSOURCES = VHDLParser.y
  4.  
  5. #flex definition
  6. flex.name = Flex
  7. flex.input = FLEXSOURCES
  8. flex.output = ${QMAKE_FILE_BASE}.cpp
  9. flex.commands = flex -i -o${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
  10. #flex.CONFIG += target_predeps
  11. flex.variable_out = SOURCES
  12. QMAKE_EXTRA_COMPILERS += flex
  13.  
  14. #bison definition
  15. bison.name = Bison
  16. bison.input = BISONSOURCES
  17. bison.output = ${QMAKE_FILE_BASE}.cpp
  18. bison.commands = bison -d -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
  19. bison.clean = position.hh stack.hh location.hh VHDLParser.hpp
  20. bison.CONFIG += target_predeps
  21. bison.variable_out = SOURCES
  22. QMAKE_EXTRA_COMPILERS += bison
  23.  
  24. OTHER_FILES += \
  25. $$BISONSOURCES \
  26. $$FLEXSOURCES
To copy to clipboard, switch view to plain text mode 

But when I build my project, the flex compiler simply doesn't start. I can clearly see bison running in the console but not flex.
Of course, when comes the time to link every object files, it doesn't work beceause yylex() is missing ...

Please tell me what's wrong with this .pro.