Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
This is my first question.
i made certain changes in the files (.cc , .h ) in ns2 .
After that i typed configure command in the terminal(in the ns2 main folder).
Code:
./configure
and then the make command
Code:
./make
got the following error message
"No such file or directory"
when typed like this,
Code:
make
got error message as
"Makefile:332:*** commands commence before first target.Stop.
The make command is a system-installed application like "ls" or "mkdir" or "diff." You do not execute it with the leading "./" because make will be found in your PATH.
You only use a leading "./" when you try to run something from your current directory.
Quote:
got error message as
"Makefile:332:*** commands commence before first target.Stop
This means that your Makefile has commands (i.e. lines beginning with a tab) before you declare a make target. Any command lines must be associated with a target. If you do not know what a target is, then you need to review the make documentation.
Specifically, the error seems to tell you that line 332 of the Makefile is the first occurrence of the pre-target command. Open the Makefile and look at line 332.
Last edited by Dark_Helmet; 01-12-2012 at 02:18 AM.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
I think, the error can happen some times with an edited Makefile / Makefile.in
where an unnecessary <space> is added after the back slashes ( \ )
The example is an ns-2.34 Makefile :
Thanks for the replies. now the make command works . but again i get the following error
Code:
In file included from common/packet.h:48,
from common/packet.cc:40:
common/ns-process.h:94: error: syntax error before `,' token
common/ns-process.h:107: error: field `type_' has incomplete type
common/ns-process.h: In constructor `AppData::AppData(AppDataType)':
common/ns-process.h:109: error: `type' has incomplete type
common/ns-process.h:60: error: forward declaration of `enum AppDataType'
common/ns-process.h:109: error: `type_' undeclared (first use this function)
common/ns-process.h:109: error: (Each undeclared identifier is reported only
once for each function it appears in.)
common/ns-process.h: In constructor `AppData::AppData(AppDataType)':
common/ns-process.h:109: error: `type' has incomplete type
common/ns-process.h:60: error: forward declaration of `enum AppDataType'
common/ns-process.h: In constructor `AppData::AppData(AppDataType)':
common/ns-process.h:109: error: `type' has incomplete type
common/ns-process.h:60: error: forward declaration of `enum AppDataType'
common/ns-process.h: In copy constructor `AppData::AppData(AppData&)':
common/ns-process.h:110: error: 'class AppData' has no member named 'type_'
common/ns-process.h: In member function `AppDataType AppData::type() const':
common/ns-process.h:113: error: return type `enum AppDataType' is incomplete
In file included from common/packet.cc:40:
common/packet.h: At global scope:
common/packet.h:176: error: syntax error before `,' token
common/packet.h: In member function `const char* p_info::name(packet_t) const':
common/packet.h:273: error: `p' has incomplete type
common/packet.h:77: error: forward declaration of `enum packet_t'
common/packet.h: In static member function `static bool
p_info::data_packet(packet_t)':
common/packet.h:277: error: `type' has incomplete type
common/packet.h:77: error: forward declaration of `enum packet_t'
common/packet.h:278: error: conversion to incomplete type
common/packet.h: In constructor `PacketData::PacketData(int)':
common/packet.h:311: error: no matching function for call to `AppData::AppData(
int)'
common/ns-process.h:110: error: candidates are: AppData::AppData(AppData&)
common/ns-process.h:109: error: AppData::AppData(AppDataType)
common/packet.h: At global scope:
common/packet.h:458: error: field `ptype_' has incomplete type
common/packet.h: In member function `packet_t& hdr_cmn::ptype()':
common/packet.h:507: error: `ptype_' undeclared (first use this function)
common/packet.cc: In member function `virtual void
CommonHeaderClass::export_offsets()':
common/packet.cc:119: error: 'struct hdr_cmn' has no member named 'ptype_'
make: *** [common/packet.o] Error 1
i am working with ns-allinone-2.29 and fedora2 .now make command works fine. i have patched ns2 with mannasim patch . i have followed the steps given in mannasim homepage.
but the sample tcl examples given in that website are giving error message.
i got this error when i executed the tcl code given for hierarchial network at the bottom of that webpage
Code:
INITIALIZE THE LIST xListHead
invalid command name "EnergyModel/BATTERY"
while executing
"EnergyModel/BATTERY create _o33 _o15 100.0 0.5 0.2"
invoked from within
"catch "$className create $o $args" msg"
invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
delete $o
return ""
}
global errorInfo
error "class $..."
(procedure "new" line 3)
invoked from within
"new $energyModel_ $node $initialEnergy_ $l1 $l2"
invoked from within
"if [info exists energyModel_] {
if [info exists level1_] {
set l1 $level1_
} else {
set l1 0.5
}
if [info exists level2_] {
set l2 $level2_
} else {..."
(procedure "_o3" line 98)
(Simulator create-wireless-node line 98)
invoked from within
"_o3 create-wireless-node"
("eval" body line 1)
invoked from within
"eval $self create-wireless-node $args"
(procedure "_o3" line 14)
(Simulator node line 14)
invoked from within
"$ns_ node"
(procedure "create_sink" line 8)
invoked from within
"create_sink"
(file "mannasim-rede-hierarquica.tcl" line 351)
Fedora 2 is ancient. Unsupported, dead for about 6 years.
( But may work.)
Quote:
If i have to install ns2.34 , have i to uninstall ns2.29.
No. You can have as many versions of ns-allinone-2.xx as you want,
installed at the same time. Just do not add any of them to a *PATH.
The mannasim patch is for ns-allinone-2.29 version 3. ( Not ns-2.34 ).
ns-allinone-2.29.3.tar.gz http://sourceforge.net/projects/nsna...ar.gz/download
cd ns-allinone-2.29/ && zcat mannasim-patch-ns2.29.tar.gz | patch -p1
&& ./install ( Usually the g++34 compiler is used for ns-2.29 ).
......
The above post # 7 :
Copy the file mannasim-rede-hierarquica.tcl to ns-allinone-2.29/ns-2.29/ , and ...
cd ns-allinone-2.29/ns-2.29/ && ./ns mannasim-rede-hierarquica.tcl :
Code:
[knudfl@localhost ns-2.29]$ ./ns mannasim-rede-hierarquica.tcl
num_nodes is set 14
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Starting Simulation...
Node 10 - Temperature Data 24.322831 - Time 9.153541
Node 11 - Temperature Data 25.043827 - Time 9.182337
Node 04 - Temperature Data 27.431498 - Time 9.230162
Node 06 - Temperature Data 25.308177 - Time 9.418064
Node 05 - Temperature Data 23.035929 - Time 9.629627
Node 13 - Temperature Data 26.608114 - Time 9.630934
Node 07 - Temperature Data 25.228390 - Time 9.655668
Node 09 - Temperature Data 26.208888 - Time 9.730951
Node 12 - Temperature Data 24.730716 - Time 9.732257
Node 08 - Temperature Data 25.663836 - Time 9.832123
Common Node 10 - Disseminating data - Time 11.154 - Destination node 2
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 129.1
SORTING LISTS ...DONE!
Cluster Head Node 2 - Received message - Time 11.158 - Source Node 10!
Common Node 11 - Disseminating data - Time 11.182 - Destination node 3
Cluster Head Node 3 - Received message - Time 11.187 - Source Node 11!
Common Node 4 - Disseminating data - Time 11.230 - Destination node 2
Cluster Head Node 2 - Received message - Time 11.234 - Source Node 4!
Common Node 6 - Disseminating data - Time 11.418 - Destination node 3
Cluster Head Node 3 - Received message - Time 11.422 - Source Node 6!
Common Node 5 - Disseminating data - Time 11.630 - Destination node 3
Common Node 13 - Disseminating data - Time 11.631 - Destination node 2
Cluster Head Node 3 - Received message - Time 11.635 - Source Node 5!
Cluster Head Node 2 - Received message - Time 11.639 - Source Node 13!
Common Node 7 - Disseminating data - Time 11.656 - Destination node 2
Cluster Head Node 2 - Received message - Time 11.660 - Source Node 7!
Common Node 9 - Disseminating data - Time 11.731 - Destination node 2
Common Node 12 - Disseminating data - Time 11.732 - Destination node 3
Cluster Head Node 2 - Received message - Time 11.735 - Source Node 9!
Cluster Head Node 3 - Received message - Time 11.740 - Source Node 12!
Common Node 8 - Disseminating data - Time 11.832 - Destination node 2
Cluster Head Node 2 - Received message - Time 11.836 - Source Node 8!
Node 10 - Temperature Data 24.308915 - Time 12.153541
Node 11 - Temperature Data 25.157340 - Time 12.182337
Node 04 - Temperature Data 23.518178 - Time 12.230162
Node 06 - Temperature Data 25.148741 - Time 12.418064
Node 05 - Temperature Data 23.996935 - Time 12.629627
Node 13 - Temperature Data 25.215901 - Time 12.630934
Node 07 - Temperature Data 26.363497 - Time 12.655668
Node 09 - Temperature Data 25.182589 - Time 12.730951
Node 12 - Temperature Data 24.574205 - Time 12.732257
Node 08 - Temperature Data 23.918326 - Time 12.832123
Cluster Head Node 3 - Disseminating Data - Destination Node 1 - Time 13.026
Access point - Received a message with 4 elements
Message received from node 3 with 1.843471 delay ::: 11.186610 13.030080
Message received from node 3 with 1.843471 delay ::: 11.186610 13.030080
Message received from node 3 with 1.843471 delay ::: 11.186610 13.030080
Message received from node 3 with 1.843471 delay ::: 11.186610 13.030080
Cluster Head Node 2 - Disseminating Data - Destination Node 1 - Time 13.545
Access point - Received a message with 6 elements
Message received from node 2 with 2.392089 delay ::: 11.157944 13.550033
Message received from node 2 with 2.392089 delay ::: 11.157944 13.550033
Message received from node 2 with 2.392089 delay ::: 11.157944 13.550033
Message received from node 2 with 2.392089 delay ::: 11.157944 13.550033
Message received from node 2 with 2.392089 delay ::: 11.157944 13.550033
Message received from node 2 with 2.392089 delay ::: 11.157944 13.550033
NS EXITING...
... And the trace file 'mannasim-rede-hierarquica.tr' is created.
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
~
~
~
~
~
~
~
~
~
~
~
"~/.bashrc" 12L, 188C 1,2 All
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Please check '/root/.bashrc' for "ns-2.28 text" and delete it.
? And may the same for /etc/bashrc ?
And please never run any ns commands as root.
The default ns2 build location is /home/<user-name/<folder>/ ,
so all commands etc. can be done as unprivileged user.
Do not log in as root, and do not use /root/Desktop/ for anything.
"root" is for administrative tasks only, not development.
Installing ns (2.29) to a system path :
cd ns-allinone-2.29/ns-2.29/ ; su ; make install && exit
( 'make install' will copy ns to /usr/local/bin/ ).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.