LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-25-2011, 10:31 PM   #1
anh_comdr
LQ Newbie
 
Registered: Sep 2011
Posts: 1

Rep: Reputation: Disabled
Question transmit video


i am making a practise about transmit video in ns2,i read in this link : http://140.116.72.80/~smallko/ns2/Evalvid_in_NS2.htm
but when i do the step 7:

Recomplie NS2

cd ns-allinone-2.27/ns-2.27

make clean; make

i have this error in terminal:

myevalvid/myudp.cc: In constructor ‘myUdpAgent::myUdpAgent()’:
myevalvid/myudp.cc:19:21: error: cannot call constructor ‘myUdpAgent::UdpAgent’ directly [-fpermissive]
myevalvid/myudp.cc:19:21: error: for a function-style cast, remove the redundant ‘::UdpAgent’ [-fpermissive]
myevalvid/myudp.cc: In member function ‘virtual void myUdpAgent::sendmsg(int, AppData*, const char*)’:
myevalvid/myudp.cc:56:123: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long unsigned int’ [-Wformat]
myevalvid/myudp.cc:78:123: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long unsigned int’ [-Wformat]
make: *** [myevalvid/myudp.o] Error 1

this is file myudp.cc:

#include "myudp.h"
#include "rtp.h"
#include "random.h"
#include "address.h"
#include "ip.h"


static class myUdpAgentClass : public TclClass {
public:
myUdpAgentClass() : TclClass("Agent/myUDP") {}
TclObject* create(int, const char*const*) {
return (new myUdpAgent());
}
} class_myudp_agent;

myUdpAgent::myUdpAgent() : id_(0), openfile(0)
{
bind("packetSize_", &size_);
UdpAgent::UdpAgent();
}

void myUdpAgent::sendmsg(int nbytes, AppData* data, const char* flags)
{
Packet *p;
int n;
char buf[100]; //added by smallko

if (size_)
n = nbytes / size_;
else
printf("Error: myUDP size = 0\n");

if (nbytes == -1) {
printf("Error: sendmsg() for UDP should not be -1\n");
return;
}

// If they are sending data, then it must fit within a single packet.
if (data && nbytes > size_) {
printf("Error: data greater than maximum myUDP packet size\n");
return;
}

double local_time = Scheduler::instance().clock();
while (n-- > 0) {
p = allocpkt();
hdr_cmn::access(p)->size() = size_;
hdr_rtp* rh = hdr_rtp::access(p);
rh->flags() = 0;
rh->seqno() = ++seqno_;
hdr_cmn::access(p)->timestamp() =
(u_int32_t)(SAMPLERATE*local_time);
hdr_cmn::access(p)->sendtime_ = local_time; // (smallko)
if(openfile!=0){
hdr_cmn::access(p)->frame_pkt_id_ = id_++;
sprintf(buf, "%-16f id %-16d udp %-16d\n", local_time, hdr_cmn::access(p)->frame_pkt_id_, hdr_cmn::access(p)->size()-28);
fwrite(buf, strlen(buf), 1, BWFile);
//printf("%-16f id %-16d udp %-16d\n", local_time, hdr_cmn::access(p)->frame_pkt_id_, hdr_cmn::access(p)->size()-28);
}
// add "beginning of talkspurt" labels (tcl/ex/test-rcvr.tcl)
if (flags && (0 ==strcmp(flags, "NEW_BURST")))
rh->flags() |= RTP_M;
p->setdata(data);
target_->recv(p);
}
n = nbytes % size_;
if (n > 0) {
p = allocpkt();
hdr_cmn::access(p)->size() = n;
hdr_rtp* rh = hdr_rtp::access(p);
rh->flags() = 0;
rh->seqno() = ++seqno_;
hdr_cmn::access(p)->timestamp() =
(u_int32_t)(SAMPLERATE*local_time);
hdr_cmn::access(p)->sendtime_ = local_time; // (smallko)
if(openfile!=0){
hdr_cmn::access(p)->frame_pkt_id_ = id_++;
sprintf(buf, "%-16f id %-16d udp %-16d\n", local_time, hdr_cmn::access(p)->frame_pkt_id_, hdr_cmn::access(p)->size()-28);
fwrite(buf, strlen(buf), 1, BWFile);
//printf("%-16f id %-16d udp %-16d\n", local_time, hdr_cmn::access(p)->frame_pkt_id_, hdr_cmn::access(p)->size()-28);
}
// add "beginning of talkspurt" labels (tcl/ex/test-rcvr.tcl)
if (flags && (0 == strcmp(flags, "NEW_BURST")))
rh->flags() |= RTP_M;
p->setdata(data);
target_->recv(p);
}
idle();
}

int myUdpAgent::command(int argc, const char*const* argv)
{
if(argc ==2) { //added by smallko
if (strcmp(argv[1], "closefile") == 0) {
if(openfile==1)
fclose(BWFile);
return (TCL_OK);
}

}

if (argc ==3) { //added by smallko
if (strcmp(argv[1], "set_filename") == 0) {
strcpy(BWfile, argv[2]);
BWFile = fopen(BWfile, "w");
openfile=1;
return (TCL_OK);
}
}

return (UdpAgent::command(argc, argv));
}

please help me
 
Old 10-27-2011, 07:10 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ.

1) The ns-2.27 modifications assumes a working build of ns-allinone-2.27.
Is that what you have ? ?


2) I haven't tried out the "mympeg ns-2.27" version.
The ns-2.28 patch works, and is easy to compile into a new 'ns' file,
when the ns-2.28-gcc410.patch is used too. See post # 7 here
http://www.linuxquestions.org/questi...10-a-867404/#7

3) You can have as many versions of ns-allinone-2.xx as you want,
installed at the same time. Just don't add anything to a path.

..
 
Old 03-12-2014, 12:13 PM   #3
asma_it
Member
 
Registered: Mar 2014
Posts: 30

Rep: Reputation: Disabled
please i have the same probleme; i instaled ns2.34 and i want to integrate evalvid into it ,after doing steps i fot this error !




yevalvid/myudp.cc: In constructor ‘myUdpAgent::myUdpAgent()’:
myevalvid/myudp.cc:19:21: error: cannot call constructor ‘myUdpAgent::UdpAgent’ directly [-fpermissive]
myevalvid/myudp.cc:19:21: error: for a function-style cast, remove the redundant ‘::UdpAgent’ [-fpermissive]
myevalvid/myudp.cc: In member function ‘virtual void myUdpAgent::sendmsg(int, AppData*, const char*)’:
myevalvid/myudp.cc:56:123: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long unsigned int’ [-Wformat]
myevalvid/myudp.cc:78:123: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long unsigned int’ [-Wformat]
make: *** [myevalvid/myudp.o] Error 1
 
Old 03-12-2014, 01:11 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Post #3, @asma_it : Welcome to LQ.

The `myevalvid' code is for ns-2.28 :
http://hpds.ee.ncku.edu.tw/~smallko/ns2/myevalvid2.htm

The code will usually compile with no errors by using g++ version 4.1.2 .

Which version of Ubuntu ?
→ a) $ uname -m <Enter>
→ b) $ cat /etc/issue

-
 
1 members found this post helpful.
Old 03-12-2014, 05:34 PM   #5
asma_it
Member
 
Registered: Mar 2014
Posts: 30

Rep: Reputation: Disabled
knudfl,Thank you very much,my ubuntu version is 13.10 ,is there any problem with? else telle me the best ubutu version with less problem with ns 2.28 an evalvid installation.
thank you
 
Old 03-12-2014, 07:47 PM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 5 : Actually there are two versions of Ubuntu 13.10 .

Hence the command $ uname -m
... which you are supposed to do , and then tell if it's i686 or x86_64.
All ns2 is for a 32bits OS = i686. And particularly ns-2.28 has x86_64 issues.
And : Not all patches / extra protocols will work with a 64bits OS.

The 32bits Ubuntu 13.10 will do OK with `myevalvid'. Tested in this very moment.

Compilers to use : gcc41 / g++41, post #47 here
http://www.linuxquestions.org/questi...532/page4.html

Building ns-2.28 with myevalvid2 , post #46 here
http://www.linuxquestions.org/questi...965/page4.html

Testing (with a copy of ns by name ns-myevalvid1310) :
$ ns-myevalvid1310 be_a01.tcl : The file out.tr 417.8 kB is created.

-
 
Old 03-13-2014, 04:52 AM   #7
asma_it
Member
 
Registered: Mar 2014
Posts: 30

Rep: Reputation: Disabled
knudfl
it is i686,I am tring this steps.
thank you
 
Old 03-13-2014, 05:57 AM   #8
asma_it
Member
 
Registered: Mar 2014
Posts: 30

Rep: Reputation: Disabled
my ubutu version is 13.10 ,but i guess that this compilator(gcc41 g++41) is for 12.10 version;



Installing all the default gcc/g++ for Ubuntu 12.10 :
$ sudo apt-get install g++-4.4 g++-4.5 g++-4.6 g++-4.7

The compilers I use on 12.10 for all ns-2.26 .... 2.34 are :
gcc41-compat*1210 https://docs.google.com/file/d/0B7S2...FQY2VJbjA/edit
g++41-compat https://docs.google.com/file/d/0B7S2...jN2M2MGU4/edit
Can be installed with :
sudo dpkg -i gcc41-compat-4.1.2-ubuntu1210_i386.deb g++41-compat-4.1.2_i386.deb
... Then reboot, and the new compiler can be used.

Using : cd ns-allinone-2.30/ && export CC=gcc41 CXX=g++41 && ./install
.. But you will still have the same poor validate result.
 
Old 03-13-2014, 06:27 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 8 .
Quote:
.. I guess that this compilator(gcc41 g++41) is for 12.10 version;
Read post #6 : This is the compiler for the 32bits Ubuntu 13.10 too !
( As long as they (Ubuntu) don't continue to change the path's in /usr/include/,
.. etc., this version will also work for later versions 13.xx, 14.xx ).


# 8 :
Quote:
my ubutu version is 13.10
Why is it so difficult for you to answer if your OS is `i686' or `x86_64' ?
There is no "13.10". It's "13.10 - 32bits" or "13.10 - 64bits".

-
 
Old 03-13-2014, 06:45 AM   #10
asma_it
Member
 
Registered: Mar 2014
Posts: 30

Rep: Reputation: Disabled
knudfl:
I answered !its i686 .
 
Old 03-13-2014, 06:54 AM   #11
asma_it
Member
 
Registered: Mar 2014
Posts: 30

Rep: Reputation: Disabled
after execute this command
sudo dpkg -i gcc41-compat-4.1.2_i386.deb g++41-compat-4.1.2_i386.deb
i got this error!
dpkg: error processing gcc41-compat-4.1.2_i386.deb (--install):
cannot access archive: No such file or directory
(Reading database ... 199064 files and directories currently installed.)
Preparing to replace g++41-compat 4.1.2 (using g++41-compat-4.1.2_i386.deb) ...
Unpacking replacement g++41-compat ...
Setting up g++41-compat (4.1.2) ...
Errors were encountered while processing:
gcc41-compat-4.1.2_i386.deb
root@asma-HP-ProBook-4520s:/home/asma/Downloads#
 
Old 03-13-2014, 06:56 AM   #12
asma_it
Member
 
Registered: Mar 2014
Posts: 30

Rep: Reputation: Disabled
@knudfl
after execute this command
sudo dpkg -i gcc41-compat-4.1.2_i386.deb g++41-compat-4.1.2_i386.deb
i got this error:
dpkg: error processing gcc41-compat-4.1.2_i386.deb (--install):
cannot access archive: No such file or directory
(Reading database ... 199064 files and directories currently installed.)
Preparing to replace g++41-compat 4.1.2 (using g++41-compat-4.1.2_i386.deb) ...
Unpacking replacement g++41-compat ...
Setting up g++41-compat (4.1.2) ...
Errors were encountered while processing:
gcc41-compat-4.1.2_i386.deb
 
Old 03-13-2014, 07:05 AM   #13
asma_it
Member
 
Registered: Mar 2014
Posts: 30

Rep: Reputation: Disabled
@knudfl
it works ,Thank you very much knudfl
 
Old 03-13-2014, 09:54 AM   #14
asma_it
Member
 
Registered: Mar 2014
Posts: 30

Rep: Reputation: Disabled
knudfl
1) tar xvf ns-allinone-2.28.tar.gz
2) patch -p0 < ns228-gcc40.patch
3) patch -p0 < ns-2.28-gcc410.patch <Enter> <Enter> <Enter>
4) cd ns-allinone-2.28/ && tar xvf myevalvid2-ns228-patch.tar.gz
I.e. myevalvid2-ns228-patch.tar.gz = Your files + myevalvid/ + Makefile.in :
https://docs.google.com/file/d/0B7S2...it?usp=sharing
5) export CC=gcc41 CXX=g++41
6) ./install : OK.
after this steps i got this!
please help me to solve this problem

configure: error: installation or configuration problem: C compiler cannot create executables.
tcl8.3.2 configuration failed! Exiting ...
Tcl is not part of the ns project. Please see www.Scriptics.com
to see if they have a fix for your platform.
 
Old 03-13-2014, 10:17 AM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 14 .
Quote:
C compiler cannot create executables.
Three possible issues ..
1) The compiler was not installed.
2) You forgot to reboot the OS.
3) You are trying to build ns-allinone-2.28 as root ( sudo su ) :
The compilers are not in root's PATH.
Solution : Check that the compilers are installed :
A) $ which gcc41
And : $ dpkg -L gcc41-compat
B) $ which g++41
And : $ dpkg -L g++41-compat

.... When you are absolutely sure that the packages are installed,
and the commands reply with answers that show gcc41 and g++41 as installed
you can put the executable in root's PATH :
a) $ cd /usr/bin/
b) sudo ln -s ../gcc41/bin/gcc41
c) sudo ln -s ../gcc41/bin/g++41


-
 
  


Reply

Tags
dselect#22, myevalvid, myevalvid2, ns2



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
transmit power fahadnasir Linux - Hardware 3 04-09-2008 11:42 AM
laptop transmit to antenna? sortia Linux - Wireless Networking 4 10-12-2006 08:05 PM
3com Transmit error Ogi Linux - Networking 5 10-09-2005 03:35 PM
eth0: Transmit timed out GuPH Linux - Networking 4 12-16-2003 08:16 PM
eth1: transmit timed out aaron Linux - Networking 0 08-27-2001 02:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:29 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
Open Source Consulting | Domain Registration