LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-02-2013, 01:08 AM   #1
najma
LQ Newbie
 
Registered: Jun 2011
Posts: 22

Rep: Reputation: Disabled
Ns-2 make error


Hi, I m working on the energy model of leach protocol, and for that using Ns-2.29 with mannasim. I have added few lines in battery.cc and battery.h ( which is used for sensor nodes), and run make command, my code compiles perfectly without any error, then I commented the changes made and run make command, now I m getting this error. I haven't access or changed any of these files but don't know why I m getting this. I'll be grateful if anyone can help in resolving this issue.
Regards,
Najma


classifier/classifier-bst.cc
classifier/classifier-bst.cc:62:17: error: ump.h: No such file or directory

classifier/classifier-bst.cc: In member function ‘virtual void MCastBSTClassifier::recv(Packet*, Handler*)’:
classifier/classifier-bst.cc:158: error: ‘hdr_ump’ was not declared in this scope
classifier/classifier-bst.cc:158: error: ‘ump’ was not declared in this scope
classifier/classifier-bst.cc:158: error: ‘hdr_ump’ is not a class or namespace
make: *** [classifier/classifier-bst.o] Error 1
 
Old 10-02-2013, 06:09 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
ump.h should be in the ns-2.29/adc/ subdirectory so check your NS2 source first? (Not that I know anything about NS2 BTW...)
 
2 members found this post helpful.
Old 10-02-2013, 08:43 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
Quote:
error: ump.h: No such file or directory
May be you somehow screwed up the "make depend settings" ?

You could try : $ make depend && make
 
1 members found this post helpful.
Old 10-03-2013, 12:16 AM   #4
najma
LQ Newbie
 
Registered: Jun 2011
Posts: 22

Original Poster
Rep: Reputation: Disabled
Hi, thanks for the reply, i have checked it and found that adc folder is somehow moved to another folder which i simply don't know how. i simply change the location of the folder and now not getting that error, but something else which i simply don't understand what it is b/c i have been working with ns-2 from last 1 year and have never experienced these issues. please guide now how to resolve the new error hundreds of lines which i m encountering when run make command. i m pasting the last few lines of the error.
regard,
najma

accessPointDiffApp.cc.text._ZN24NRSimpleAttributeFactoryIfE4findEPSt6vectorIP11NRAttributeSaIS3_EE PN9__gnu_cxx17__normal_iteratorIPS3_S5_EE[NRSimpleAttributeFactory<float>::find(std::vector<NRAttribute*, std::allocator<NRAttribute*> >*, __gnu_cxx::__normal_iterator<NRAttribute**, std::vector<NRAttribute*, std::allocator<NRAttribute*> > >*)]+0x3a): undefined reference to `NRAttribute::find_key_from(int, std::vector<NRAttribute*, std::allocator<NRAttribute*> >*, __gnu_cxx::__normal_iterator<NRAttribute**, std::vector<NRAttribute*, std::allocator<NRAttribute*> > >, __gnu_cxx::__normal_iterator<NRAttribute**, std::vector<NRAttribute*, std::allocator<NRAttribute*> > >*)'
mannasim/diffusion/accessPointDiffApp.o.rodata._ZTI18AccessPointDiffApp[typeinfo for AccessPointDiffApp]+0x18): undefined reference to `typeinfo for DiffApp'
collect2: ld returned 1 exit status
make: *** [ns] Error 1
root@ubuntu:/home/najmaismat/ns-allinone-2.29/ns-2.29#
 
Old 10-03-2013, 09:45 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
# 4 .

Looks like you are using the wrong compiler ?
What's in the Makefile line 37 ? CPP = ??

Your error output : Difficult to read without the code tags.
Please edit post #4 to use code tags.
I.e. type [/code] at text end, and [code] at text start :
http://www.linuxquestions.org/questi....php?do=bbcode

-
 
Old 10-03-2013, 04:12 PM   #6
najma
LQ Newbie
 
Registered: Jun 2011
Posts: 22

Original Poster
Rep: Reputation: Disabled
hi,
on line 37 of Make.in file: CPP = @CXX@

Edited Post # 4
Code:
gnu_cxx::__normal_iterator<NRAttribute**, std::vector<NRAttribute*, std::allocator<NRAttribute*> > >*)]+0x3a): undefined reference to `NRAttribute::find_key_from(int, std::vector<NRAttribute*, std::allocator<NRAttribute*> >*, __gnu_cxx::__normal_iterator<NRAttribute**, std::vector<NRAttribute*, std::allocator<NRAttribute*> > >, __gnu_cxx::__normal_iterator<NRAttribute**, std::vector<NRAttribute*, std::allocator<NRAttribute*> > >*)'
mannasim/diffusion/accessPointDiffApp.o: In function `NRSimpleAttributeFactory<float>::find(std::vector<NRAttribute*, std::allocator<NRAttribute*> >*, __gnu_cxx::__normal_iterator<NRAttribute**, std::vector<NRAttribute*, std::allocator<NRAttribute*> > >*)':
accessPointDiffApp.cc:(.text._ZN24NRSimpleAttributeFactoryIfE4findEPSt6vectorIP11NRAttributeSaIS3_EEPN9__gnu_cxx17__normal_iteratorIPS3_S5_EE[NRSimpleAttributeFactory<float>::find(std::vector<NRAttribute*, std::allocator<NRAttribute*> >*, __gnu_cxx::__normal_iterator<NRAttribute**, std::vector<NRAttribute*, std::allocator<NRAttribute*> > >*)]+0x3a): undefined reference to `NRAttribute::find_key_from(int, std::vector<NRAttribute*, std::allocator<NRAttribute*> >*, __gnu_cxx::__normal_iterator<NRAttribute**, std::vector<NRAttribute*, std::allocator<NRAttribute*> > >, __gnu_cxx::__normal_iterator<NRAttribute**, std::vector<NRAttribute*, std::allocator<NRAttribute*> > >*)'
mannasim/diffusion/accessPointDiffApp.o:(.rodata._ZTI18AccessPointDiffApp[typeinfo for AccessPointDiffApp]+0x18): undefined reference to `typeinfo for DiffApp'
collect2: ld returned 1 exit status
make: *** [ns] Error 1
 
Old 10-03-2013, 04:40 PM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
# 6 .

! It's not about the "Makefile.in" !

Repeat : What's in the 'Makefile' , line 37 ? CPP = ??
 
Old 10-03-2013, 05:09 PM   #8
najma
LQ Newbie
 
Registered: Jun 2011
Posts: 22

Original Poster
Rep: Reputation: Disabled
#7
At line 37 of Makefile

CPP = g++
 
Old 10-04-2013, 03:13 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
# 8 .

OK, seems that you generated a new Makefile.

Either edit line 37 to your g++ version 4.1.2, like
CPP = g++41

Or reconfigure ns-2.29/ by including your compiler :
$ export CXX=g++41 && ./configure


P.S. : It's always a good idea to save the original Makefile :
$ cp Makefile Makefile.orig
... then you could have checked the original line 37.

-
 
Old 10-04-2013, 06:33 AM   #10
najma
LQ Newbie
 
Registered: Jun 2011
Posts: 22

Original Poster
Rep: Reputation: Disabled
Ok thanks..will let you know the outcome .
 
Old 10-04-2013, 08:56 AM   #11
najma
LQ Newbie
 
Registered: Jun 2011
Posts: 22

Original Poster
Rep: Reputation: Disabled
hi,
i m getting this when run
$ export CXX=g++41 && ./configure
$ make

Code:
Explicitly disabling static compilation
checking for dlopen in -ldl... yes
checking for a BSD-compatible install... /usr/bin/install -c
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tcl/lib/ns-autoconf.tcl
config.status: creating indep-utils/webtrace-conv/ucb/Makefile
config.status: creating indep-utils/webtrace-conv/dec/Makefile
config.status: creating indep-utils/webtrace-conv/nlanr/Makefile
config.status: creating indep-utils/webtrace-conv/epa/Makefile
config.status: creating indep-utils/cmu-scen-gen/setdest/Makefile
config.status: creating autoconf.h
config.status: autoconf.h is unchanged
root@ubuntu:/home/najmaismat/ns-allinone-2.29/ns-2.29# make
/home/najmaismat/ns-allinone-2.29/bin/tclsh8.4 bin/tcl-expand.tcl tcl/lib/ns-lib.tcl  | ../tclcl-1.17/tcl2c++ et_ns_lib > gen/ns_tcl.cc
g++41 -c -Wall  -DTCP_DELAY_BIND_ALL -DNO_TK -DTCLCL_CLASSINSTVAR  -DNDEBUG -DLINUX_TCP_HEADER -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_11 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCL_H  -DHAVE_CONFIG_H -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=no -DUSE_SINGLE_ADDRESS_SPACE -Drng_test -I. -I/home/najmaismat/ns-allinone-2.29/tclcl-1.17 -I/home/najmaismat/ns-allinone-2.29/otcl-1.11 -I/home/najmaismat/ns-allinone-2.29/include -I/home/najmaismat/ns-allinone-2.29/include -I/usr/include/pcap -I./tcp -I./sctp -I./common -I./link -I./queue -I./adc -I./apps -I./mac -I./mobile -I./trace -I./routing -I./tools -I./classifier -I./mcast -I./diffusion3/lib/main -I./diffusion3/lib -I./diffusion3/lib/nr -I./diffusion3/ns -I./diffusion3/filter_core -I./asim/ -I./qs -I./diffserv -I./satellite -I./wpan -o gen/ns_tcl.o gen/ns_tcl.cc
make: g++41: Command not found
make: *** [gen/ns_tcl.o] Error 127
root@ubuntu:/home/najmaismat/ns-allinone-2.29/ns-2.29#
 
Old 10-04-2013, 10:52 AM   #12
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
# 11.
Quote:
make: g++41: Command not found
You will of course have to install a {gcc/g++ version 4.1.2}
before you can use it.
*** Note : Must be ns-allinone-2.29.3.tar.gz

Which Ubuntu are you using ?
Please show the replies from these two commands :
1. $ uname -m <Enter>
2. $ cat /etc/issue

-
 
Old 10-04-2013, 11:00 AM   #13
najma
LQ Newbie
 
Registered: Jun 2011
Posts: 22

Original Poster
Rep: Reputation: Disabled
Post#12

i have ns-allinone-2.29.3.tar.gz

najmaismat@ubuntu:~$ uname -m
x86_64
najmaismat@ubuntu:~$ cat /etc/issue
Ubuntu 10.04.4 LTS \n \l
 
Old 10-04-2013, 11:07 AM   #14
najma
LQ Newbie
 
Registered: Jun 2011
Posts: 22

Original Poster
Rep: Reputation: Disabled
Post# 13 when i try to install {gcc/g++ version 4.1.2}, i m getting this error:

najmaismat@ubuntu:~$ sudo apt-get install gcc-4.1.2
[sudo] password for najmaismat:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package gcc-4.1.2
najmaismat@ubuntu:~$ sudo apt-get install g++-4.1.2
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package g++-4.1.2
najmaismat@ubuntu:~$
 
Old 10-04-2013, 03:38 PM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
# 14 .

If "gcc-4.1" is still available on the old Ubuntu 10.04,
the install command is : $ sudo apt-get install g++-4.1
( 'gcc-4.1' is automatically installed as dependency.)


Note : ns2 is for a 32bits OS (i686) not 64bits (x86_64),
though some ns2 versions and some patches will work on 64bits.
But with a reduced functionality. (Inferior validate result.)

Ubuntu 10.04 / gcc-4.1 / g++-4.1, the install command is
$ export CC=gcc-4.1 CXX=g++-4.1 && ./install
Configuring ns-2.29/ :
$ export CC=gcc-4.1 CXX=g++-4.1 && ./configure


-

Last edited by knudfl; 10-04-2013 at 03:44 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Make file error code 1 make: *** [AIQ7] Error 1 raju39k Linux - Newbie 2 04-09-2012 02:22 PM
RH9 make menuconfig error: make[1]: *** [lxdialog] Error 1 rrochele Linux - Kernel 3 02-07-2007 04:39 PM


All times are GMT -5. The time now is 05:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration