PDA

View Full Version : Using flex with Qt4



xgoan
22nd October 2008, 16:49
Hi,

I'm developing an named.conf parser with flex. Anyone can help me to build it?
I have no idea about how to link it with Qt4. There is any tutorial or howto?

Thanks

jpn
22nd October 2008, 17:21
Have you noticed LEXSOURCES (http://doc.trolltech.com/4.4/qmake-variable-reference.html#lexsources)?

xgoan
24th October 2008, 11:34
I have added the file to LEXSOURCES but does not compile, this is the exit of the make:


named.conf_lex.cpp:118: error: expected initializer before ‘.’ token
named.conf_lex.cpp:119: error: expected initializer before ‘.’ token
named.conf_lex.cpp:242: error: expected initializer before ‘.’ token
named.conf_lex.cpp:254: error: expected initializer before ‘.’ token
named.conf_lex.cpp:256: error: expected initializer before ‘.’ token
named.conf_lex.cpp:257: error: expected initializer before ‘.’ token
named.conf_lex.cpp:258: error: expected initializer before ‘.’ token
named.conf_lex.cpp:259: error: expected initializer before ‘.’ token
named.conf_lex.cpp:260: error: expected initializer before ‘.’ token
named.conf_lex.cpp:261: error: expected initializer before ‘.’ token
named.conf_lex.cpp:264: error: expected initializer before ‘.’ token
named.conf_lex.cpp:265: error: expected initializer before ‘.’ token
named.conf_lex.cpp:266: error: expected initializer before ‘.’ token
named.conf_lex.cpp:294: error: expected initializer before ‘.’ token
named.conf_lex.cpp:296: error: expected initializer before ‘.’ token
named.conf_lex.cpp:442: error: expected initializer before ‘.’ token
lex.named.conf.c:592: error: expected initializer before ‘.’ token
named.conf_lex.cpp:227: warning: ‘yy_current_buffer’ defined but not used
named.conf_lex.cpp:237: warning: ‘yy_hold_char’ defined but not used
named.conf_lex.cpp:239: warning: ‘yy_n_chars’ defined but not used
named.conf_lex.cpp:245: warning: ‘yy_c_buf_p’ defined but not used
named.conf_lex.cpp:246: warning: ‘yy_init’ defined but not used
named.conf_lex.cpp:247: warning: ‘yy_start’ defined but not used
named.conf_lex.cpp:252: warning: ‘yy_did_buffer_switch_on_eof’ defined but not used
named.conf_lex.cpp:268: warning: ‘void* yy_flex_alloc(yy_size_t)’ declared ‘static’ but never defined
named.conf_lex.cpp:269: warning: ‘void* yy_flex_realloc(void*, yy_size_t)’ declared ‘static’ but never defined
named.conf_lex.cpp:270: warning: ‘void yy_flex_free(void*)’ declared ‘static’ but never defined
named.conf_lex.cpp:299: warning: ‘yy_state_type yy_get_previous_state()’ declared ‘static’ but never defined
named.conf_lex.cpp:300: warning: ‘yy_state_type yy_try_NUL_trans(yy_state_type)’ declared ‘static’ but never defined
named.conf_lex.cpp:301: warning: ‘int yy_get_next_buffer()’ declared ‘static’ but never defined
named.conf_lex.cpp:302: warning: ‘void yy_fatal_error(const char*)’ declared ‘static’ but never defined
named.conf_lex.cpp:432: warning: ‘yy_last_accepting_state’ defined but not used
named.conf_lex.cpp:433: warning: ‘yy_last_accepting_cpos’ defined but not used
lex.named.conf.c:462: warning: ‘void yyunput(int, char*)’ declared ‘static’ but never defined
lex.named.conf.c:475: warning: ‘int yyinput()’ declared ‘static’ but never defined

xgoan
24th October 2008, 11:46
When I build manually the lexer it works.

jpn
24th October 2008, 16:21
What is the difference between the commands? I mean the one run by make (written by qmake to the Makefile) and the one you run by hand.