LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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-29-2015, 01:51 AM   #1
IrfanQasmi
LQ Newbie
 
Registered: Oct 2015
Posts: 7

Rep: Reputation: Disabled
undefined reference to `hdr_hls::offset_'


Hello,
I am using ns2.34 version on red hat linux 5.
I need to install a new patch gpsr in my tcl file.
I found a gpsr patch named-gpsr-KeLiu_ns234.patch.
after installing this patch I have done reconfigure ns2.34 and ater that i tried make clean amd make.
than i got this error-

trace/cmu-trace.o: In function `hdr_hls::access(Packet const*)':
cmu-trace.cc.text._ZN7hdr_hls6accessEPK6Packet[hdr_hls::access(Packet const*)]+0x7): undefined reference to `hdr_hls:ffset_'
trace/cmu-trace.o: In function `hdr_locs::access(Packet const*)':
cmu-trace.cc.text._ZN8hdr_locs6accessEPK6Packet[hdr_locs::access(Packet const*)]+0x7): undefined reference to `hdr_locs:ffset_'
collect2: ld returned 1 exit status
make: *** [ns] Error 1

Please help me. its urgent.

Thanks

Irfan Khan
 
Old 10-30-2015, 08:31 AM   #2
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: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Welcome to LQ.

? I guess you mean RHEL 5.11 : Redhat Enterprise Linux 5.11 ?

"Red hat linux 5.0" was released year 1997, and is not to be used.

? What's the reply from the command 'cat /etc/redhat-release'



-

Last edited by knudfl; 10-30-2015 at 08:35 AM.
 
Old 10-30-2015, 06:45 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,818

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
not a ns2 expert but

the last minor upgrade to 5.11 should have updated to gcc 4.4

BUT
As i recall ns2 NEEDS gcc 4.1 to be used
or the compat-gcc-34-3.4.6

4.1 is in the repos " gcc-4.1.2-55.el5.x86_64.rpm"
 
Old 10-31-2015, 12:50 AM   #4
IrfanQasmi
LQ Newbie
 
Registered: Oct 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hello Kundfl,

I have entered the command which you told me and got this message

cat /etc/redhat-release

Red Hat Enterprise Linux Server release 5.2 (Tikanga)

Now what should I do?
 
Old 10-31-2015, 01:42 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: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Re #4.

OK, RHEL 5.x : The default compilers are gcc/g++ version 4.1.2, unless you changed gcc.
RHEL 5.2 : You forgot to update (since year 2008).
With all security updates etc. (# yum update), `redhat-release' now shows "release 5.11".

We will need some information about gcc/g++ : $ g++ --version | grep g++

Your errors are indicating that a later compiler than gcc-4.1.2 is used.
Or, you could be doing something else wrong ?

Build example :
$ tar xvf ns-allinone-2.34.tar.gz
$ cd ns-allinone-2.34/
$ patch -p0 < gpsr-KeLiu_ns234.patch
$ patch -p0 < ns234_gcc49.patch (Required if gcc is a later version than 4.1.2).
https://drive.google.com/file/d/0B7S...ew?usp=sharing
$ ./install
$ cd ns-2.34/
$ cp ns ns-gpsr-keliu
$ sudo cp ns-gpsr-keliu /usr/local/bin/
$ cd gpsr/
$ ns-gpsr-keliu wireless-gpsr.tcl

-
 
Old 10-31-2015, 06:59 AM   #6
IrfanQasmi
LQ Newbie
 
Registered: Oct 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hello knudfl

I have done as you instructed. now after sucessfully installing the patch when i have run wireless-gpsr file than i got this message

[root@localhost gpsr]# ns wireless-gpsr.tclnum_nodes is set 100
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
GPSR configuration file
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Load complete...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 129.2
SORTING LISTS ...DONE!
NS EXITING...
[root@localhost gpsr]# nam wireless-gpsr.nam
Cannot connect to existing nam instance. Starting a new one...
Segmentation fault


Thanks

Irfan Khan
 
Old 10-31-2015, 09:06 AM   #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: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Re #6.

You are not telling where you got 'nam' or how it was built.
A 'nam' build will most often fail with any ns-allinone-2 version.

Hence the tested packages :
http://www.linuxquestions.org/questi...-4175524760/#2
... And a version for the old RHEL5 : nam-1.14-fc6.el5.i386.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
Please download the package.

Then delete all nam present on your OS :
Any binary 'nam', and the nam-1.14/ folder.
( And the nam text lines in .bashrc, if you added some *PATH text.)

Then you can unpack nam-1.14-fc6.el5.i386.tar.gz
And : $ cd nam-1.14-fc6.el5.i386./
# cp nam /usr/local/bin/

-

Last edited by knudfl; 10-31-2015 at 09:08 AM.
 
Old 10-31-2015, 09:51 AM   #8
IrfanQasmi
LQ Newbie
 
Registered: Oct 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Dear Knudfl

I have got nam-1.14 in the ns-2.34 package. i have complete package of ns-2.34allinone.

I have never faced this (nam) problem in ns-2.34allinone pack but this time when I run wireless-gpsr.tcl it shows me NS exiting... message. After it I am executing nam file which is generating from wireless-gpsr.tcl file than I got Segmentation Error.

Thanks
Irfan Khan
 
Old 10-31-2015, 10:03 AM   #9
IrfanQasmi
LQ Newbie
 
Registered: Oct 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Dear Knudfl

I am facing one more problem when I am running my tcl file using gpsr patch. If I am using AODV than this script is running well but if I changed routing protocol as GPSR, I have got this error.

The error is as follow

num_nodes is set 12

(_o14 cmd line 1)
invoked from within
"_o14 cmd addr"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o14" line 2)
(SplitObject unknown line 2)
invoked from within
"_o14 addr"
("eval" body line 1)
invoked from within
"eval $node addr $args"
("default" arm line 2)
invoked from within
"switch -exact $routingAgent_ {
DSDV {
set ragent [$self create-dsdv-agent $node]
}
DSR {
$self at 0.0 "$node start-dsr"
}
AODV {
set ragent [$self cre..."
(procedure "_o3" line 14)
(Simulator create-wireless-node line 14)
invoked from within
"_o3 create-wireless-node"
("eval" body line 1)
invoked from within
"eval $self create-wireless-node $args"
(procedure "_o3" line 23)
(Simulator node line 23)
invoked from within
"$ns_ node"
invoked from within
"set Server0 [$ns_ node]"
(file "HybridNetwork.tcl" line 102)


Please tell the solution of this error.
 
Old 10-31-2015, 10:10 AM   #10
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: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Re #8.

Sorry, forgot that gpsr-** isn't supporting NAM.
You can get a nam trace file created.
But running the file shows an empty NAM window.
And you get `Segmentation fault' when the play button is used.


-
 
Old 10-31-2015, 10:16 AM   #11
IrfanQasmi
LQ Newbie
 
Registered: Oct 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Re #10

Thanks for quick reply but how can I run NAM in gpsr?
How can I run my own tcl script using GPSR.
I have also asked a question in the post #9.
Please reply.

Thanks
 
Old 10-31-2015, 10:19 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: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Re #9.

$ ns234-gpsr-keliu HybridNetwork.tcl : "HybridNetwork.tcl" is an unknown file.

Please use a default 'ns' with no disturbing patches for default simulations.

You are supposed to have like /usr/local/bin/{ ns-orig, ns234-gpsr-keliu }.

Suggest : Build another ns-allinone-2.34 with no patches.
And use the new executable "ns-orig" to run "non gpsr" simulations.
You can have as many ns-allinone-2* as you want, installed at the same time.
But do never add any *PATH text to .bashrc . Not required.


-

Last edited by knudfl; 10-31-2015 at 10:20 AM.
 
Old 10-31-2015, 10:29 AM   #13
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: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Re your post #11.

The GPSR-KeLiu examples : GPSR-KeLiu-examples_01.2015.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing

See post #10 : "Not supporting nam" : There is nothing you can do.
( Several other protocols also have no NAM support.)


-
 
Old 11-02-2015, 12:40 AM   #14
IrfanQasmi
LQ Newbie
 
Registered: Oct 2015
Posts: 7

Original Poster
Rep: Reputation: Disabled
Dear knudfl

After Successfully installed the GPSR patch, I still have the errors as I told you in #9

I use follwing command for GPSR in ns-2.34

1. ./configure
2. make clean
3. make
4. sudo make install

I got this message

gpsr/gpsr.h: In constructor GPSRAgent::GPSRAgent():
gpsr/gpsr.h:114: warning: GPSRAgent::query_timer_ will be initialized after
gpsr/gpsr.h:101: warning: nsaddr_t GPSRAgent::my_id_
gpsr/gpsr.cc:105: warning: when initialized here
gpsr/gpsr.cc: In member function void GPSRAgent::forwardData(Packet*):
gpsr/gpsr.cc:241: warning: comparison between signed and unsigned integer expressions

And should I make changes in ns-lib.tcl file for GPSR?
 
  


Reply

Tags
gpsr, ns2


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
error in ns2 after make command: undefined reference to `hdr_mcv:: offset_' mary1001 Programming 1 07-27-2014 04:43 AM
C++ undefined reference grob115 Programming 4 01-22-2013 12:22 PM
undefined reference to.... crapodino Programming 1 01-13-2008 08:05 PM
undefined reference to... dimah Programming 3 12-27-2006 10:57 AM
Undefined reference to: ashlesha Programming 5 11-08-2006 02:07 PM


All times are GMT -5. The time now is 06:52 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