nsc and recent distros

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

nsc and recent distros

Natale Patriciello

I am trying to get nsc working with recent distros. I encountered few
problems, all fixed by editing the build scripts (every time I work with
something related to ns3, I need to learn another build tool...), but
now I have a missing reference:

scons: Reading SConscript files ...
Checking target architecure...(cached) amd64, checking userland ...(cached) amd64
scons: done reading SConscript files.
scons: Building targets ...
g++ -o globaliser/parser.tab.o -c -Wall -g -O globaliser/parser.tab.cc
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-pc-linux-gnu/6.3.1/../../../../lib/libfl.so: undefined reference to `yylex'
collect2: error: ld returned 1 exit status
scons: *** [globaliser/globaliser] Error 1
scons: building terminated because of errors.

The fact is that the function yylex is defined in
globaliser/ilex.cc, and I suppose is inside the object
globaliser/ilex.o. But as it seems, it is not found. Maybe it is a
problem between linking of C and C++ files? I remember (old memories)
that flex outputs C files instead of C++.

Any suggestion?

Thanks
Nat
Reply | Threaded
Open this post in threaded view
|

Re: nsc and recent distros

Tom Henderson-2
On 02/14/2017 04:50 AM, Natale Patriciello wrote:

>
> I am trying to get nsc working with recent distros. I encountered few
> problems, all fixed by editing the build scripts (every time I work with
> something related to ns3, I need to learn another build tool...), but
> now I have a missing reference:
>
> scons: Reading SConscript files ...
> Checking target architecure...(cached) amd64, checking userland ...(cached) amd64
> scons: done reading SConscript files.
> scons: Building targets ...
> g++ -o globaliser/parser.tab.o -c -Wall -g -O globaliser/parser.tab.cc
> 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-pc-linux-gnu/6.3.1/../../../../lib/libfl.so: undefined reference to `yylex'
> collect2: error: ld returned 1 exit status
> scons: *** [globaliser/globaliser] Error 1
> scons: building terminated because of errors.
>
> The fact is that the function yylex is defined in
> globaliser/ilex.cc, and I suppose is inside the object
> globaliser/ilex.o. But as it seems, it is not found. Maybe it is a
> problem between linking of C and C++ files? I remember (old memories)
> that flex outputs C files instead of C++.
>
> Any suggestion?

You should be able to install nsc using bake, if you have necessary flex
and bison dependencies (flex, bison, libfl-dev, or equivalents).
Although I haven't tried on a gcc-6 machine...

./bake.py configure -e ns-3-allinone
./bake.py download
./bake.py build

(or ./bake.py configure -e ns-allinone-3.26 for last release)

- Tom