LinuxQuestions.org
Help answer threads with 0 replies.
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 01-15-2016, 10:44 AM   #1
mahnoorbaloch
LQ Newbie
 
Registered: Jan 2016
Posts: 6

Rep: Reputation: Disabled
Question cmu-trace.cc:(28.text+0x4b6): undefined refrence to


hello
i am implementing dv-hop localization algorithm in ns2.34
when i am issuin command 'make'
i am getting error:
cmu-trace.cc28.text+0x4b6): undefined refrence to 'hdr_dvhop:ffset_'
collect2: ld returned 1 exit status
make: ***[ns] Error 1


plz help me soon
 
Old 01-16-2016, 06:07 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: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
Welcome to LQ.

Looks like one or more errors in your C++ code.

Suggest : Upload the code files to e.g. 'Google Docs', and ask here :
https://stackoverflow.com/questions/tagged/ns2
 
Old 01-17-2016, 01:05 AM   #3
mahnoorbaloch
LQ Newbie
 
Registered: Jan 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
which code that i have add in the trace/cmu-trace.cc file ?
the doc which i have followed i have attached plz let me kno if there are errors or mistake ?
thanks for yor rep
Attached Files
File Type: pdf How to add DV-Hop PM algorithm in NS2.pdf (75.1 KB, 4 views)
 
Old 01-17-2016, 08:25 AM   #4
mahnoorbaloch
LQ Newbie
 
Registered: Jan 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
the previous error i have solved i include the libraries in the trace/cmu-trace.cc file
#define dvhop/dvhop_packet.h
#define dvhop/dvhop.h
#define dvhop/dvhop.cc
bt now it shows an other error:
 
Old 01-17-2016, 08:28 AM   #5
mahnoorbaloch
LQ Newbie
 
Registered: Jan 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
the previous error i have solved i include the libraries in the trace/cmu-trace.cc file
#define dvhop/dvhop_packet.h
#define dvhop/dvhop.h
#define dvhop/dvhop.cc
bt now it shows an other error:
Attached Thumbnails
Click image for larger version

Name:	new error.jpg
Views:	6
Size:	286.4 KB
ID:	20560  
 
Old 01-17-2016, 08:34 AM   #6
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
Re #5.

Please do not show any text as an image.
I guess you know how to copy / paste a text to a new text-file.txt ?

* No errors are shown.
Please try with Google : Nothing to be done for `all'.
( Means that everything is OK.)


-
 
Old 01-17-2016, 10:01 AM   #7
mahnoorbaloch
LQ Newbie
 
Registered: Jan 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
sory actually i am new at this i will not upload pic next tym thanks for your rep
i tried google but no solution worked

and if there is no error then my tcl script should run but it is not running only dv-hop_802_11.tcl other tcl are running smoothly means still the algorithm is not implemented right? or there is any other problem?
 
Old 01-18-2016, 02:48 PM   #8
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
Re #7.
Quote:
.. my tcl script should run but it is not running only dv-hop_802_11.tcl
other tcl are running smoothly means still the algorithm is not implemented right ?
or there is any other problem ?
Please rephrase. Short sentences must be used ,,, ending with a period ( . ).
One long line with things mixed isn't understandable.


-
 
Old 01-19-2016, 02:16 AM   #9
mahnoorbaloch
LQ Newbie
 
Registered: Jan 2016
Posts: 6

Original Poster
Rep: Reputation: Disabled
my protocol DV-Hop is implemented.
but now its shows error in tcl script:
# Generated by Topology Generator for Network Simulator (c) DVHOP
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 50 ;# max packet in ifq
set val(nn) 9 ;# number of mobilenodes
set val(rp) DVHOP ;# protocol type
set val(x) 1000 ;# X dimension of topography
set val(y) 1000 ;# Y dimension of topography
set val(stop) 50 ;# simulation period

set ns [new Simulator]
$ns use-scheduler Heap

set tracefd [open dvhop-802-11.tr w]
set namtrace [open dvhop-802-11.nam w]

$ns trace-all $tracefd
$ns namtrace-all-wireless $namtrace $val(x) $val(y)

# set up topography object
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)

create-god $val(nn)

# configure the nodes
$ns node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channel [new $val(chan)] \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace OFF \

for {set i 0} {$i < $val(nn) } { incr i } { //showing error at this line
set mnode_($i) [$ns node]
$mnode_($i) random-motion 0
}


# Position of Anchor 1
$mnode_(0) set X_ 150.00
$mnode_(0) set Y_ 200.00
$mnode_(0) set Z_ 0.0
$mnode_(0) label "Anchor1"

# Position of Anchor 2
$mnode_(1) set X_ 480.00
$mnode_(1) set Y_ 500.00
$mnode_(1) set Z_ 0.0
$mnode_(1) label "Anchor2"

# Position of Anchor 3
$mnode_(2) set X_ 980.00
$mnode_(2) set Y_ 150.00
$mnode_(2) set Z_ 0.0
$mnode_(2) label "Anchor3"

# Position of Node 1
$mnode_(3) set X_ 300.00
$mnode_(3) set Y_ 350.00
$mnode_(3) set Z_ 0.0

# Position of Node 2
$mnode_(4) set X_ 400.00
$mnode_(4) set Y_ 250.00
$mnode_(4) set Z_ 0.0

# Position of Node 3
$mnode_(5) set X_ 520.00
$mnode_(5) set Y_ 300.00
$mnode_(5) set Z_ 0.0

# Position of Node 4
$mnode_(6) set X_ 620.00
$mnode_(6) set Y_ 180.00
$mnode_(6) set Z_ 0.0

# Position of Node 5
$mnode_(7) set X_ 720.00
$mnode_(7) set Y_ 210.00
$mnode_(7) set Z_ 0.0

# Position of Node 6
$mnode_(8) set X_ 920.00
$mnode_(8) set Y_ 230.00
$mnode_(8) set Z_ 0.0

#start sending beacon message
$ns at 0.0 "[$mnode_(0) set ragent_] anchor"

#start sending beacon message
$ns at 0.0 "[$mnode_(1) set ragent_] anchor"

#start sending beacon message
$ns at 0.0 "[$mnode_(2) set ragent_] anchor"


for {set i 0} {$i < $val(nn)} { incr i } {
$ns initial_node_pos $mnode_($i) 5
}

# Telling nodes when the simulation ends
for {set i 0} {$i < $val(nn) } { incr i } {
$ns at $val(stop) "$mnode_($i) reset;"
}

# ending nam and the simulation
$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
$ns at $val(stop) "stop"
$ns at [expr $val(stop) + 0.01] "puts "end simulation"; $ns halt"
proc stop {} {
global ns tracefd namtrace
$ns flush-trace
close $tracefd
close $namtrace
#exec nam dvhop-802-11.nam &

}

$ns run

error at line 47: invoked from within
i have mentioned the error line in coments
if any one can sole the error plz help me
or have any other tcl script for dvhop then plz give me
thanks
 
  


Reply

Tags
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
compilation error: text+0x1e undefined refrence to a function pankaj8332 Linux - Newbie 5 10-28-2013 10:40 AM
insllation of gives trace/cmu-trace.cc:1531:9: error: stray \342 in program error rakeshpanchiwala Linux - Newbie 17 04-26-2013 02:28 AM
problem in modifying cmu-trace.cc file in ns2.34 avinash20 Programming 3 09-12-2012 07:06 AM
Sir, While installing ns2.34 on fedora 16 got the error : trace/cmu-trace.cc 1327:22 jeevanpinto Linux - Newbie 2 06-28-2012 04:35 AM
undefined refrence while reverse dependency in shared library.. er_khatke Linux - Newbie 1 08-25-2009 05:24 AM


All times are GMT -5. The time now is 07:32 AM.

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