LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   undefined reference to `hdr_hls::offset_' (https://www.linuxquestions.org/questions/linux-newbie-8/undefined-reference-to-%60hdr_hls-offset_-4175557426/)

IrfanQasmi 10-29-2015 12:51 AM

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::offset_'
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::offset_'
collect2: ld returned 1 exit status
make: *** [ns] Error 1

Please help me. its urgent.

Thanks

Irfan Khan

knudfl 10-30-2015 07:31 AM

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'



-

John VV 10-30-2015 05:45 PM

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"

IrfanQasmi 10-30-2015 11:50 PM

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?

knudfl 10-31-2015 12:42 AM

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

-

IrfanQasmi 10-31-2015 05:59 AM

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

knudfl 10-31-2015 08:06 AM

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/

-

IrfanQasmi 10-31-2015 08:51 AM

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

IrfanQasmi 10-31-2015 09:03 AM

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.

knudfl 10-31-2015 09:10 AM

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.


-

IrfanQasmi 10-31-2015 09:16 AM

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

knudfl 10-31-2015 09:19 AM

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.


-

knudfl 10-31-2015 09:29 AM

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.)


-

IrfanQasmi 11-01-2015 11:40 PM

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?


All times are GMT -5. The time now is 10:29 AM.