Note: the following is for ANTLR v2, not for ANTLR v3. It also assumes that you don't use the 'exportVocab' keyword in the 'options' block for your Lexer. It also can not be used if you want to create a shared library containing your lexer/parser, as the list of sources returned by the tool includes header files and text files, which G++ will refuse to package in a shared library. Tested Oct 2007 with 'cantlr' deb package on Ubuntu 7.04.