nsc 0.5.3 compilation error with flex

48 views
Skip to first unread message

Luca Barbierato

unread,
Oct 10, 2018, 9:13:48 AM10/10/18
to ns-3-users
Dear all,

I'm trying to compile NSC to add it in my ns-3-dev build. Once I clone the repository through:


And I run the python code:

python scons.py

I'm experiencing this error:

scons: Reading SConscript files ...
Checking target architecure...(cached) amd64, checking userland ...amd64
Checking for C library fl... yes
scons: done reading SConscript files.
scons: Building targets ...
flex -t globaliser/lexer.l > globaliser/lexer.lex.cc
bison --defines=globaliser//parser.tab.hh globaliser/parser.yc -o globaliser/parser.tab.cc
globaliser/parser.yc: warning: 1 shift/reduce conflict [-Wconflicts-sr]
g++ -o globaliser/lexer.lex.o -c -Wall -g -O globaliser/lexer.lex.cc
g++ -o globaliser/parser.tab.o -c -Wall -g -O globaliser/parser.tab.cc
g++ -o globaliser/ilex.o -c -Wall -g -O globaliser/ilex.cc
g++ -o globaliser/handle_global.o -c -Wall -g -O globaliser/handle_global.cc
g++ -o globaliser/node.o -c -Wall -g -O globaliser/node.cc
globaliser/node.cc: In member function 'bool node_t::handle_global(std::__cxx11::string, std::__cxx11::list<std::__cxx11::basic_string<char> >*, std::__cxx11::list<std::__cxx11::basic_string<char> >*)':
globaliser/node.cc:906:36: warning: variable 'str_start' set but not used [-Wunused-but-set-variable]
               string::size_type i, str_start, str_end;
                                    ^
globaliser/node.cc:772:40: warning: variable 'declarator' set but not used [-Wunused-but-set-variable]
             *initialiser_node = NULL, *declarator = NULL;
                                        ^
globaliser/node.cc:483:9: warning: variable 'orig_newlines' set but not used [-Wunused-but-set-variable]
     int orig_newlines;
         ^
g++ -o globaliser/globaliser globaliser/lexer.lex.o globaliser/parser.tab.o globaliser/ilex.o globaliser/handle_global.o globaliser/node.o -lfl
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libfl.so: undefined reference to `yylex'
collect2: error: ld returned 1 exit status
scons: *** [globaliser/globaliser] Error 1
scons: building terminated because of errors.

Here my environment details:

Ubuntu Version: 18.04.1 LTS
Python Version: 2.7.15rc1
NSC Version:    0.5.3
flex Version:   2.6.4
bison Version:  3.0.4
g++ Version:    5.5.0 20171010 (Ubuntu 5.5.0-12ubuntu1) (downgraded from g++-7 because NSC requires use of gcc-4.9 or gcc-5 series)

Could somebody help me to solve the problem?
Reply all
Reply to author
Forward
0 new messages