LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-06-2008, 09:24 AM   #1
shyan
LQ Newbie
 
Registered: Dec 2008
Posts: 14

Rep: Reputation: 0
I am getting following errors while compiling the existing dsdv.cc


[root@localhost dsdv]# c++ dsdv.cc
/usr/src/ns-allinone-2.33/tclcl-1.19/tclcl-mappings.h: In static member function ‘static int TclObjectHelper<T>::dispatch_(void*, Tcl_Interp*, int, char**)’:
/usr/src/ns-allinone-2.33/tclcl-1.19/tclcl-mappings.h:51: error: expected unqualified-id before ‘=’ token
/usr/src/ns-allinone-2.33/tclcl-1.19/tclcl-mappings.h:51: error: abstract declarator ‘Tcl&’ used as declaration
/usr/src/ns-allinone-2.33/tclcl-1.19/tclcl-mappings.h:52: error: expected primary-expression before ‘*’ token
/usr/src/ns-allinone-2.33/tclcl-1.19/tclcl-mappings.h:52: error: expected primary-expression before ‘)’ token
/usr/src/ns-allinone-2.33/tclcl-1.19/tclcl-mappings.h:57: error: expected primary-expression before ‘.’ token
/usr/src/ns-allinone-2.33/ns-2.33/common/packet.h: At global scope:
/usr/src/ns-allinone-2.33/ns-2.33/common/packet.h:582: error: expected identifier before numeric constant
/usr/src/ns-allinone-2.33/ns-2.33/common/packet.h:582: error: expected `}' before numeric constant
/usr/src/ns-allinone-2.33/ns-2.33/common/packet.h:582: error: expected unqualified-id before numeric constant
/usr/src/ns-allinone-2.33/ns-2.33/common/packet.h:591: error: ‘dir_t’ does not name a type
/usr/src/ns-allinone-2.33/ns-2.33/common/packet.h:640: error: expected initializer before ‘&’ token
/usr/src/ns-allinone-2.33/ns-2.33/common/packet.h:650: error: expected declaration before ‘}’ token


Please Suggest me some solutions whether the code is incorrect or I am doing something wrong.
 
Old 12-06-2008, 11:09 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,629

Rep: Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267
'ns-allinone-2.33' will compile on most Linux's with
no errors.

There are some dependencies : xll-devel or libx11-dev
and some related, different names from e.g Fedora to Ubntu.

If you want help, better information on Linux name and
version is required, every time a question is asked.

The errors shown will tell more, when you show the lines,
where the errors start. Will usually show mising librarary
or missing files.h .

http://www.linuxquestions.org/linux/...Ask_a_Question
http://linuxsilo.net/docs/smart-questions_en.html

http://www.linuxquestions.org/questi...?highlight=ns2
....

Last edited by knudfl; 12-06-2008 at 11:14 AM.
 
Old 12-07-2008, 02:49 AM   #3
shyan
LQ Newbie
 
Registered: Dec 2008
Posts: 14

Original Poster
Rep: Reputation: 0
The Linux that I am using is Fedora 8. As you suggested there were some header file errors but I managed that by using the absolute paths as following.
I have used this syntax
#ifndef tcl
#define tcl
#include </usr/src/ns-allinone-2.33/tcl8.4.18/generic/tcl.h>
#endif [

in place of #include <tcl.h>

This removed all of the header file inclusion error but still the errors in the first post were obtained.
 
Old 12-07-2008, 05:26 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,629

Rep: Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267
I compiled 'ns-allinone-2.33' on Fedora 8 half a year ago
with no errors at all !!

Not as root and not in /usr/src . Not recommended.
" /home/shyan/tmp/ns-allinone-2.33 " should be preferred.
( Or somewhere else in your /home and done as normal user )

'root' is for administration only, and has a very limited
set of path's in Fedora.

Give it a try, very difficult to fail with this.
....
 
Old 12-08-2008, 12:54 AM   #5
shyan
LQ Newbie
 
Registered: Dec 2008
Posts: 14

Original Poster
Rep: Reputation: 0
Cool I applied your methd and got these errors.

After your suggestion errors that I received
Why it is not recognizing the path specified as
#include <aodv/aodv.h>
#include <aodv/aodv_packet.h>
#include <random.h>
#include <cmu-trace.h>


Do I have to set any path after installation while I am working in the BIN of ns-2.33

[Shyan@localhost aodv]$ c++ aodv.cc
aodv.cc:33:23: error: aodv/aodv.h: No such file or directory
aodv.cc:34:30: error: aodv/aodv_packet.h: No such file or directory
aodv.cc:35:20: error: random.h: No such file or directory
aodv.cc:36:23: error: cmu-trace.h: No such file or directory
aodv.cc:57: error: ‘hdr_aodv’ has not been declared
aodv.cc:58: error: expected class-name before ‘{’ token
aodv.cc: In constructor ‘AODVHeaderClass::AODVHeaderClass()’:
aodv.cc:60: error: class ‘AODVHeaderClass’ does not have any field named ‘PacketHeaderClass’
aodv.cc:61: error: ‘hdr_all_aodv’ was not declared in this scope
aodv.cc:62: error: ‘hdr_aodv’ has not been declared
aodv.cc:62: error: ‘bind_offset’ was not declared in this scope
aodv.cc: At global scope:
aodv.cc:66: error: expected class-name before ‘{’ token
aodv.cc:69: error: ISO C++ forbids declaration of ‘TclObject’ with no type
aodv.cc:69: error: expected ‘;’ before ‘*’ token
aodv.cc:74: error: expected `;' before ‘}’ token
aodv.cc: In constructor ‘AODVclass::AODVclass()’:
aodv.cc:68: error: class ‘AODVclass’ does not have any field named ‘TclClass’
aodv.cc: At global scope:
aodv.cc:78: error: ‘AODV’ has not been declared
aodv.cc: In function ‘int command(int, const char* const*)’:
aodv.cc:80: error: ‘Tcl’ was not declared in this scope
aodv.cc:80: error: ‘tcl’ was not declared in this scope
aodv.cc:80: error: ‘Tcl’ is not a class or namespace
aodv.cc:82: error: ‘strncasecmp’ was not declared in this scope
aodv.cc:83: error: ‘index’ was not declared in this scope
aodv.cc:84: error: ‘TCL_OK’ was not declared in this scope
aodv.cc:87: error: ‘strncasecmp’ was not declared in this scope
aodv.cc:88: error: ‘btimer’ was not declared in this scope
aodv.cc:88: error: ‘Event’ was not declared in this scope
aodv.cc:88: error: expected primary-expression before ‘)’ token
aodv.cc:91: error: ‘htimer’ was not declared in this scope
aodv.cc:91: error: expected primary-expression before ‘)’ token
aodv.cc:92: error: ‘ntimer’ was not declared in this scope
aodv.cc:92: error: expected primary-expression before ‘)’ token
aodv.cc:95: error: ‘rtimer’ was not declared in this scope
aodv.cc:95: error: expected primary-expression before ‘)’ token
aodv.cc:96: error: ‘TCL_OK’ was not declared in this scope
aodv.cc:100: error: ‘strcmp’ was not declared in this scope
aodv.cc:101: error: ‘index’ was not declared in this scope
aodv.cc:101: error: ‘atoi’ was not declared in this scope
aodv.cc:102: error: ‘TCL_OK’ was not declared in this scope
aodv.cc:106: error: ‘logtarget’ was not declared in this scope
aodv.cc:106: error: ‘Trace’ was not declared in this scope
aodv.cc:106: error: expected primary-expression before ‘)’ token
aodv.cc:106: error: expected `;' before ‘TclObject’
aodv.cc:108: error: ‘TCL_ERROR’ was not declared in this scope
aodv.cc:109: error: ‘TCL_OK’ was not declared in this scope
aodv.cc:112: error: ‘rqueue’ was not declared in this scope
aodv.cc:113: error: ‘TCL_OK’ was not declared in this scope
aodv.cc:114: error: ‘Agent’ has not been declared
aodv.cc:117: error: ‘ifqueue’ was not declared in this scope
aodv.cc:117: error: ‘PriQueue’ was not declared in this scope
aodv.cc:117: error: expected primary-expression before ‘)’ token
aodv.cc:117: error: expected `;' before ‘TclObject’
aodv.cc:120: error: ‘TCL_ERROR’ was not declared in this scope
aodv.cc:121: error: ‘TCL_OK’ was not declared in this scope
aodv.cc:124: error: ‘dmux_’ was not declared in this scope
aodv.cc:124: error: ‘PortClassifier’ was not declared in this scope
aodv.cc:124: error: expected primary-expression before ‘)’ token
aodv.cc:124: error: expected `;' before ‘TclObject’
aodv.cc:126: error: ‘stderr’ was not declared in this scope
aodv.cc:127: error: ‘fprintf’ was not declared in this scope
aodv.cc:128: error: ‘TCL_ERROR’ was not declared in this scope
aodv.cc:130: error: ‘TCL_OK’ was not declared in this scope
aodv.cc:133: error: ‘Agent’ has not been declared
aodv.cc: At global scope:
aodv.cc:140: error: ‘AODV’ has not been declared
aodv.cc:140: error: expected constructor, destructor, or type conversion before ‘(’ token
aodv.cc:161: error: ‘BroadcastTimer’ has not been declared
aodv.cc:161: error: variable or field ‘handle’ declared void
aodv.cc:161: error: ‘Event’ was not declared in this scope
aodv.cc:161: error: expected primary-expression before ‘)’ token
aodv.cc:161: error: expected ‘,’ or ‘;’ before ‘{’ token
aodv.cc:167: error: ‘HelloTimer’ has not been declared
aodv.cc:167: error: variable or field ‘handle’ declared void
aodv.cc:167: error: redefinition of ‘int handle’
aodv.cc:161: error: ‘int handle’ previously defined here
aodv.cc:167: error: ‘Event’ was not declared in this scope
aodv.cc:167: error: expected primary-expression before ‘)’ token
aodv.cc:176: error: ‘NeighborTimer’ has not been declared
aodv.cc:176: error: variable or field ‘handle’ declared void
aodv.cc:176: error: redefinition of ‘int handle’
aodv.cc:161: error: ‘int handle’ previously defined here
aodv.cc:176: error: ‘Event’ was not declared in this scope
aodv.cc:176: error: expected primary-expression before ‘)’ token
aodv.cc:182: error: ‘RouteCacheTimer’ has not been declared
aodv.cc:182: error: variable or field ‘handle’ declared void
aodv.cc:182: error: redefinition of ‘int handle’
aodv.cc:161: error: ‘int handle’ previously defined here
aodv.cc:182: error: ‘Event’ was not declared in this scope
aodv.cc:182: error: expected primary-expression before ‘)’ token
aodv.cc:189: error: ‘LocalRepairTimer’ has not been declared
aodv.cc:189: error: variable or field ‘handle’ declared void
aodv.cc:189: error: redefinition of ‘int handle’
aodv.cc:161: error: ‘int handle’ previously defined here
aodv.cc:189: error: ‘Event’ was not declared in this scope
aodv.cc:189: error: ‘p’ was not declared in this scope
 
Old 12-08-2008, 02:05 PM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,629

Rep: Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267
To build ns-allinone-2.33 :

'cd ns-allinone-2.33' ( use actual path )

[Shyan@localhost ns-allinone-2.33]$ ./install

... very simple, isnt't it ?

When the build is finished, a text will tell, how
to setup ns.
Probably also to be found in one of the links on this site
http://www.isi.edu/nsnam/ns/ns-build.html

Please also consider ns-2.33 / nam-1.13 . See the same link.
Possibly easier to use on Linux.
....
 
Old 12-13-2008, 04:06 AM   #7
shyan
LQ Newbie
 
Registered: Dec 2008
Posts: 14

Original Poster
Rep: Reputation: 0
Angry I am being helpless

Quote:
Originally Posted by knudfl View Post
To build ns-allinone-2.33 :

'cd ns-allinone-2.33' ( use actual path )

[Shyan@localhost ns-allinone-2.33]$ ./install

... very simple, isnt't it ?

When the build is finished, a text will tell, how
to setup ns.
Probably also to be found in one of the links on this site
http://www.isi.edu/nsnam/ns/ns-build.html

Please also consider ns-2.33 / nam-1.13 . See the same link.
Possibly easier to use on Linux.
....

I tried your method but still I am facing the problem where I am unable to compile the existing c++ files. The errors obtained are

[Shyan@localhost dsdv]$ c++ dsdv.cc
In file included from dsdv.cc:44
dsdv.h:44:20: error: config.h: No such file or directory
dsdv.h:45:19: error: agent.h: No such file or directory
dsdv.h:46:16: error: ip.h: No such file or directory
dsdv.h:47:19: error: delay.h: No such file or directory
dsdv.h:48:23: error: scheduler.h: No such file or directory
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward/queue.h:31,
from dsdv.h:49,
from dsdv.cc:44:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
In file included from dsdv.cc:44:
dsdv.h:50:19: error: trace.h: No such file or directory
dsdv.h:51:17: error: arp.h: No such file or directory
dsdv.h:52:16: error: ll.h: No such file or directory
dsdv.h:53:17: error: mac.h: No such file or directory
dsdv.h:54:22: error: priqueue.h: No such file or directory
dsdv.cc:47:20: error: random.h: No such file or directory
dsdv.cc:49:23: error: cmu-trace.h: No such file or directory
dsdv.cc:50:21: error: address.h: No such file or directory
dsdv.cc:51:24: error: mobilenode.h: No such file or directory
rtable.h:66: error: ‘nsaddr_t’ does not name a type
rtable.h:67: error: ‘nsaddr_t’ does not name a type
rtable.h:81: error: ISO C++ forbids declaration of ‘Event’ with no type
rtable.h:81: error: expected ‘;’ before ‘*’ token
rtable.h:87: error: ISO C++ forbids declaration of ‘Event’ with no type
rtable.h:87: error: expected ‘;’ before ‘*’ token
rtable.h:88: error: ISO C++ forbids declaration of ‘PacketQueue’ with no type
rtable.h:88: error: expected ‘;’ before ‘*’ token
rtable.h:103: error: expected ‘;’ before ‘(’ token
dsdv.h:70: error: expected class-name before ‘{’ token
dsdv.h:76: error: ‘Packet’ has not been declared
dsdv.h:79: error: ‘Event’ has not been declared
dsdv.h:80: error: ISO C++ forbids declaration of ‘Packet’ with no type
dsdv.h:80: error: expected ‘;’ before ‘*’ token
dsdv.h:81: error: ‘Packet’ has not been declared
dsdv.h:81: error: ‘Handler’ has not been declared
dsdv.h:83: error: ‘Packet’ has not been declared
dsdv.h:89: error: ISO C++ forbids declaration of ‘Packet’ with no type
dsdv.h:89: error: expected ‘;’ before ‘*’ token
dsdv.h:96: error: ‘Packet’ has not been declared
dsdv.h:97: error: ‘Packet’ has not been declared
dsdv.h:100: error: ‘Packet’ has not been declared
dsdv.h:104: error: ISO C++ forbids declaration of ‘Trace’ with no type
dsdv.h:104: error: expected ‘;’ before ‘*’ token
dsdv.h:108: error: ISO C++ forbids declaration of ‘PriQueue’ with no type
dsdv.h:108: error: expected ‘;’ before ‘*’ token
dsdv.h:115: error: ISO C++ forbids declaration of ‘MobileNode’ with no type
dsdv.h:115: error: expected ‘;’ before ‘*’ token
dsdv.h:118: error: ISO C++ forbids declaration of ‘NsObject’ with no type
dsdv.h:118: error: expected ‘;’ before ‘*’ token
dsdv.h:120: error: ISO C++ forbids declaration of ‘Event’ with no type
dsdv.h:120: error: expected ‘;’ before ‘*’ token
dsdv.h:145: error: expected class-name before ‘{’ token
dsdv.h:148: error: ‘Event’ has not been declared
dsdv.cc: In function ‘double jitter(double, int)’:
dsdv.cc:73: error: ‘Random’ has not been declared
dsdv.cc: In member function ‘void DSDV_Agent::trace(char*, ...)’:
dsdv.cc:81: error: ‘tracetarget’ was not declared in this scope
dsdv.cc:85: error: ‘tracetarget’ was not declared in this scope
dsdv.cc: At global scope:
dsdv.cc:91: error: variable or field ‘tracepkt’ declared void
dsdv.cc:91: error: ‘int DSDV_Agent::tracepkt’ is not a static member of ‘class DSDV_Agent’
dsdv.cc:91: error: ‘Packet’ was not declared in this scope
dsdv.cc:91: error: ‘p’ was not declared in this scope
dsdv.cc:91: error: expected primary-expression before ‘double’
dsdv.cc:91: error: expected primary-expression before ‘int’
dsdv.cc:91: error: expected primary-expression before ‘const’
dsdv.cc:91: error: initializer expression list treated as compound expression
dsdv.cc:92: error: expected ‘,’ or ‘;’ before ‘{’ token

Is it impossible to compile the existing c++ file then how can I compile the c++ file that I have changed?
 
Old 12-14-2008, 02:59 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,629

Rep: Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267
http://www.linuxquestions.org/questi...ibrary-690046/
Please see post # 2.
Quote:
'cd ns-allinone-2.33/ns-2.33/' .. './configure' .. 'make'
I guess, you can build edited c++ files with the same Makefile.
Quote:
In file included from dsdv.cc:44:

dsdv.h:44:20: error: config.h: No such file or directory
dsdv.h:45:19: error: agent.h: No such file or directory
dsdv.h:46:16: error: ip.h: No such file or directory
dsdv.h:47:19: error: delay.h: No such file or directory
dsdv.h:48:23: error: scheduler.h: No such file or directory

dsdv.h:50:19: error: trace.h: No such file or directory
dsdv.h:51:17: error: arp.h: No such file or directory
dsdv.h:52:16: error: ll.h: No such file or directory
dsdv.h:53:17: error: mac.h: No such file or directory
dsdv.h:54:22: error: priqueue.h: No such file or directory
dsdv.cc:47:20: error: random.h: No such file or directory
dsdv.cc:49:23: error: cmu-trace.h: No such file or directory
dsdv.cc:50:21: error: address.h: No such file or directory
dsdv.cc:51:24: error: mobilenode.h: No such file or directory
The way to find all locale "files.h" is in the Makefile
( ns-allinone-2.33/ns-2.33/Makefile ) like this, from line 64
Quote:
INCLUDES = \
-I. \
-I. \
-I/home/knudfl/8tmp/ns-allinone-2.33/tclcl-1.19 \
-I/home/knudfl/8tmp/ns-allinone-2.33/otcl-1.13 \
-I/home/knudfl/8tmp/ns-allinone-2.33/tk8.4.18/generic \
-I/home/knudfl/8tmp/ns-allinone-2.33/tcl8.4.18/generic -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
So not using the Makefile > no finding the includes.
....

Last edited by knudfl; 12-14-2008 at 03:22 AM.
 
Old 12-15-2008, 02:36 AM   #9
shyan
LQ Newbie
 
Registered: Dec 2008
Posts: 14

Original Poster
Rep: Reputation: 0
Question Do we need to modify the already existing header files?

Quote:
Originally Posted by knudfl View Post
http://www.linuxquestions.org/questi...ibrary-690046/
Please see post # 2.

I guess, you can build edited c++ files with the same Makefile.

The way to find all locale "files.h" is in the Makefile
( ns-allinone-2.33/ns-2.33/Makefile ) like this, from line 64

So not using the Makefile > no finding the includes.
....
I checked the Makefile and the contents are there. I used the static path for testing whether the given code is working or not. I got the following errors.
Do we need to modify the already existing header files?

[root@localhost dsdv]# gcc dsdv.cc
/usr/src/ns-allinone-2.33/tclcl-1.19/tclcl-mappings.h: In static member function ‘static int TclObjectHelper<T>::dispatch_(void*, Tcl_Interp*, int, char**)’:
/usr/src/ns-allinone-2.33/tclcl-1.19/tclcl-mappings.h:50: error: expected unqualified-id before ‘=’ token
/usr/src/ns-allinone-2.33/tclcl-1.19/tclcl-mappings.h:50: error: abstract declarator ‘Tcl&’ used as declaration
/usr/src/ns-allinone-2.33/tclcl-1.19/tclcl-mappings.h:51: error: expected primary-expression before ‘*’ token
/usr/src/ns-allinone-2.33/tclcl-1.19/tclcl-mappings.h:51: error: expected primary-expression before ‘)’ token
/usr/src/ns-allinone-2.33/tclcl-1.19/tclcl-mappings.h:56: error: expected primary-expression before ‘.’ token
/usr/src/ns-allinone-2.33/ns-2.33/link/delay.h: At global scope:
/usr/src/ns-allinone-2.33/ns-2.33/link/delay.h:70: error: expected unqualified-id before ‘)’ token
/usr/src/ns-allinone-2.33/nam-1.13/trace.h:103: error: declaration does not declare anything
/usr/src/ns-allinone-2.33/nam-1.13/trace.h:110: error: expected unqualified-id before ‘[’ token
/usr/src/ns-allinone-2.33/nam-1.13/trace.h:124: error: declaration does not declare anything
/usr/src/ns-allinone-2.33/nam-1.13/trace.h:154: error: declaration does not declare anything
/usr/src/ns-allinone-2.33/ns-2.33/routing/route.h: In member function ‘virtual int RouteLogicAlgo::lookup_flat(char*, char*, int&)’:
/usr/src/ns-allinone-2.33/ns-2.33/routing/route.h:131: error: expected unqualified-id before ‘=’ token
/usr/src/ns-allinone-2.33/ns-2.33/routing/route.h:131: error: abstract declarator ‘Tcl&’ used as declaration
/usr/src/ns-allinone-2.33/ns-2.33/routing/route.h:132: error: expected primary-expression before ‘.’ token
/usr/src/ns-allinone-2.33/ns-2.33/routing/route.h:133: error: expected primary-expression before ‘.’ token
/usr/src/ns-allinone-2.33/ns-2.33/routing/rtmodule.h: At global scope:
/usr/src/ns-allinone-2.33/ns-2.33/routing/rtmodule.h:95: error: expected unqualified-id before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/routing/rtmodule.h:95: error: invalid member function declaration
/usr/src/ns-allinone-2.33/ns-2.33/routing/rtmodule.h:147: error: ISO C++ forbids declaration of ‘HierClassifier’ with no type
/usr/src/ns-allinone-2.33/ns-2.33/routing/rtmodule.h:147: error: expected ‘;’ before ‘*’ token
/usr/src/ns-allinone-2.33/ns-2.33/common/parentnode.h:78: error: expected unqualified-id before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/common/node.h:108: error: expected unqualified-id before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/common/node.h:108: error: invalid member function declaration
/usr/src/ns-allinone-2.33/ns-2.33/common/node.h:154: error: expected unqualified-id before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/common/node.h:215: error: expected unqualified-id before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/common/node.h:215: error: invalid member function declaration
/usr/src/ns-allinone-2.33/ns-2.33/common/node.h:216: error: expected unqualified-id before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/common/node.h:216: error: invalid member function declaration
/usr/src/ns-allinone-2.33/ns-2.33/mac/phy.h:122: error: expected unqualified-id before ‘void’
/usr/src/ns-allinone-2.33/ns-2.33/mac/phy.h:122: error: expected `)' before ‘void’
/usr/src/ns-allinone-2.33/ns-2.33/mac/phy.h:122: error: abstract declarator ‘Node*’ used as declaration
/usr/src/ns-allinone-2.33/ns-2.33/mac/phy.h:122: error: expected ‘;’ before ‘void’
/usr/src/ns-allinone-2.33/ns-2.33/mac/phy.h:123: error: expected `;' before ‘virtual’
/usr/src/ns-allinone-2.33/ns-2.33/mac/phy.h:123: error: expected unqualified-id before ‘void’
/usr/src/ns-allinone-2.33/ns-2.33/mac/phy.h:123: error: expected `)' before ‘void’
/usr/src/ns-allinone-2.33/ns-2.33/mac/phy.h:123: error: abstract declarator ‘Channel*’ used as declaration
/usr/src/ns-allinone-2.33/ns-2.33/mac/phy.h:123: error: expected ‘;’ before ‘void’
/usr/src/ns-allinone-2.33/ns-2.33/mac/phy.h:125: error: expected `;' before ‘virtual’
/usr/src/ns-allinone-2.33/ns-2.33/mac/phy.h: In member function ‘virtual void Phy::setnode(Node*)’:
/usr/src/ns-allinone-2.33/ns-2.33/mac/phy.h:121: error: expected primary-expression before ‘;’ token
dsdv.h: At global scope:
dsdv.h:120: error: expected unqualified-id before ‘int’
dsdv.h:120: error: expected `)' before ‘int’
dsdv.h:120: error: abstract declarator ‘Packet*’ used as declaration
dsdv.h:120: error: expected ‘;’ before ‘int’
dsdv.h:122: error: expected unqualified-id before ‘char’
dsdv.h:122: error: expected `)' before ‘char’
dsdv.h:157: error: expected unqualified-id before ‘;’ token
dsdv.h:157: error: abstract declarator ‘char*’ used as declaration
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h:54: error: expected unqualified-id before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h:54: error: invalid member function declaration
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h:60: error: expected unqualified-id before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h: In static member function ‘static void Random::seed(int)’:
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h:57: error: expected primary-expression before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h: In static member function ‘static int Random::seed_heuristically()’:
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h:58: error: expected primary-expression before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h:58: error: expected primary-expression before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h: In static member function ‘static double Random::uniform()’:
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h:61: error: expected primary-expression before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h: In static member function ‘static double Random::uniform(double)’:
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h:62: error: expected primary-expression before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h: In static member function ‘static double Random::uniform(double, double)’:
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h:63: error: expected primary-expression before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h: In static member function ‘static double Random::exponential()’:
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h:64: error: expected primary-expression before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h: In static member function ‘static int Random::integer(int)’:
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h:65: error: expected primary-expression before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h: In static member function ‘static double Random::exponential(double)’:
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h:66: error: expected primary-expression before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h: In static member function ‘static double Random:areto(double, double)’:
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h:67: error: expected primary-expression before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h: In static member function ‘static double Random:aretoII(double, double)’:
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h:68: error: expected primary-expression before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h: In static member function ‘static double Random::normal(double, double)’:
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h:69: error: expected primary-expression before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h: In static member function ‘static double Random::lognormal(double, double)’:
/usr/src/ns-allinone-2.33/ns-2.33/tools/random.h:70: error: expected primary-expression before ‘)’ token
/usr/src/ns-allinone-2.33/ns-2.33/trace/cmu-trace.h: At global scope:
/usr/src/ns-allinone-2.33/ns-2.33/trace/cmu-trace.h:116: error: ‘BaseTrace’ has not been declared
/usr/src/ns-allinone-2.33/ns-2.33/trace/cmu-trace.h:118: error: ‘BaseTrace’ has not been declared
/usr/src/ns-allinone-2.33/ns-2.33/common/mobilenode.h:153: error: expected unqualified-id before ‘;’ token
/usr/src/ns-allinone-2.33/ns-2.33/common/mobilenode.h:153: error: abstract declarator ‘MobileNode*’ used as declaration
/usr/src/ns-allinone-2.33/ns-2.33/common/mobilenode.h: In constructor ‘PositionHandler::PositionHandler(MobileNode*)’:
/usr/src/ns-allinone-2.33/ns-2.33/common/mobilenode.h:150: error: anachronistic old-style base class initializer
/usr/src/ns-allinone-2.33/ns-2.33/common/mobilenode.h:150: error: no matching function for call to ‘Handler::Handler(MobileNode*&)’
/usr/src/ns-allinone-2.33/ns-2.33/common/scheduler.h:75: note: candidates are: Handler::Handler()
/usr/src/ns-allinone-2.33/ns-2.33/common/scheduler.h:75: note: Handler::Handler(const Handler&)
dsdv.cc: At global scope:
dsdv.cc:91: error: expected unqualified-id before ‘(’ token
dsdv.cc: In member function ‘void DSDV_Agent:utput_rte(const char*, rtable_ent*, DSDV_Agent*)’:
dsdv.cc:138: error: expected unqualified-id before ‘(’ token
dsdv.cc: In constructor ‘DSDV_Agent:SDV_Agent()’:
dsdv.cc:1113: error: expected primary-expression before ‘=’ token
dsdv.cc: In member function ‘void DSDV_Agent::startUp()’:
dsdv.cc:1124: error: expected primary-expression before ‘=’ token
 
Old 12-15-2008, 08:25 AM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,629

Rep: Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267
gcc dsdv.cc : gcc is for '.c' files, dsdv.cc is a 'c++' program.
c++ dsdv.cc would work, if there were no local includes.

The #include "dsdv.h" will be found, "priqueue.h" not.

Then have a look into "dsdv.h" and see, that it again has
11 (eleven) includes calling other headers with new includes
and so on .... all from ns-2.33, no path specified.

So editing the includes in all headers ( there are many )
to an absolute path would be an endless job .... and that
is why you have the Makefile, taking care of all that.
( The count is 564 headers, but you won't use all ! ! )

Example dsdv.h line 45 edited to #include "../common/agent.h"
> > "agent.h" then again have includes, not found.

So you will probably not get anything without the current
"ns-allinone-2.33/ns-2.33/Makefile"
....

Last edited by knudfl; 12-15-2008 at 10:35 AM.
 
Old 12-15-2008, 08:59 AM   #11
shyan
LQ Newbie
 
Registered: Dec 2008
Posts: 14

Original Poster
Rep: Reputation: 0
Unhappy Do we need to have the object code file of the c++ file before we use the make ?

Quote:
Originally Posted by knudfl View Post
gcc dsdv.cc : gcc is for '.c' files, dsdv.cc is a 'c++' program.
c++ dsdv.cc would work, if there were no local includes.

The #include "dsdv.h" will be found, "priqueue.h" not.

Then have a look into "dsdv.h" and see, that it again have
11 (eleven) includes calling other headers with new includes
and so on ......

So editing the includes in all headers ( there are many )
to an absolute path would be an endless job .... and that
is why you have the Makefile, taking care of all that.
( The count is 564 headers, but you won't use all ! ! )

Example dsdv.h line 45 edited to #include "../common/agent.h"
> > "agent.h" then again have includes, not found.

So you will probably not get anything without the current
"ns-allinone-2.33/ns-2.33/Makefile"
....
Do we need to have the object code file of the c++ file before we use the make command or just the c++ file?
 
Old 12-15-2008, 10:55 AM   #12
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,629

Rep: Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267Reputation: 3267
The "Makefile" asks g++ to build the object from the .cc file.

Try open the directory ns-allinone-2.33/ns-2.33/dsdv
and see 2 files ".o" They can be deleted, and make
can be run again, and watch what is happening ...
The objects will be made again, and copies of the 2
files are linked to an executable ( nse )
together with "100" other objects.

Also please read the Makefile line 37 .. 261 ..
....

Last edited by knudfl; 12-15-2008 at 11:06 AM.
 
  


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
Various Compiling Errors (GCC compiling Openal, GUIlib, xmms-wma) gregorya Linux - Software 2 08-27-2004 05:03 AM
Errors compiling boombastic Linux - Newbie 7 08-04-2004 03:09 PM
Errors when compiling anything! adizzle Linux - Newbie 4 06-16-2004 05:27 PM
QT compiling errors slackwarefan Slackware 1 03-01-2004 07:45 PM
Errors compiling 2.6.0 plisken Linux - General 3 10-10-2003 05:12 PM


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