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.
Hello,
this is my first question on this forum,hope to get a satisfactory answer.
i have ubuntu 9.10 installed on my laptop with ns-allinone-2.31.
i want to add a new module to NS2. i edited Makefile.in under
/home/ns-allinone-2.31/ns-2.31 directory. whenever i enter command
make -f Makefile.in
i get
make: *** [tools/random.o] Error 127
error.
i have gcc version 4.4.1.
i think some bug in ns-allinone-2.31 or some thing?
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Welcome to LQ. .. .. ..
The usual approach would be, I think : cp Makefile Makefile-backup
&& cp Makefile.in Makefile.in-backup.
Then edit Makefile.in to include the new object, and run configure
to have a new Makefile created. ( And then run 'make'.)
.. Or you can edit the Makefile itself.
Running make -f Makefile.in is quite unusual.
Makefile and Makefile.in are not identical.
( 'diff Makefile.in Makefile' will show.)
It can of course be an error in your code.
Don't know, what "error 127" means.
..
thanks for reply.
there is no "Makefile" in ns2-31 ,just Makefile.in and makefile.vc.
i edited Makefile.in and added my own project.
when i run command
make
with no arguments it says
make: **** NO targets specified,
thats why i run
make -f Makefile.in
and it gives me error
make: *** [tools/random.o] Error 127
i havent done any thing to built in NS2 classes.
i dont know where is the problem.
Quote:
Originally Posted by knudfl
Welcome to LQ. .. .. ..
The usual approach would be, I think : cp Makefile Makefile-backup
&& cp Makefile.in Makefile.in-backup.
Then edit Makefile.in to include the new object, and run configure
to have a new Makefile created. ( And then run 'make'.)
.. Or you can edit the Makefile itself.
Running make -f Makefile.in is quite unusual.
Makefile and Makefile.in are not identical.
( 'diff Makefile.in Makefile' will show.)
It can of course be an error in your code.
Don't know, what "error 127" means.
..
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Makefle.in is used by 'configure' to create a Makefile.
Makefile.in cannot be used by 'make'.
Just run ./configure to get a Makefile created.
But the correct / best way to do it is :
cd ns-allinone-2.31/ && ./install
Then you are sure, that the four dependencies tcl, tk, otcl, tclcl
are created. ( And can be used, when you compile ns.)
I.e first run install, then :
cd ns-allinone-2.31/ && mv ns ns-backup
And now you can add your own code, and edit Makefile.in + run ./configure.
Or alternatively edit Makefile, and run make.
..
Hi all,
When add some modules to ns-2 2.31 in ubantu 12.04 and before run the make file i have follow the above statement.
1. ./install
The below error is coming.
In file included from tools/random.h:42:0,
from tools/random.cc:41:
tools/rng.h:104:1: error: expected class-name before ‘{’ token
tools/rng.h:369:61: error: ‘FILE’ has not been declared
tools/random.cc:50:1: error: ‘RANDOM_RETURN_TYPE’ does not name a type
make: *** [tools/random.o] Error 1
Ns make failed!
Please help to remove the error
Thanks you !!!!
Last edited by Soumenkanrar; 07-17-2013 at 11:53 PM.
Hi all,
When add some modules to ns-2 2.31 in ubantu 12.04 and before run the make file i have follow the above statement.
1. ./install
The below error is coming.
In file included from tools/random.h:42:0,
from tools/random.cc:41:
tools/rng.h:104:1: error: expected class-name before ‘{’ token
tools/rng.h:369:61: error: ‘FILE’ has not been declared
tools/random.cc:50:1: error: ‘RANDOM_RETURN_TYPE’ does not name a type
make: *** [tools/random.o] Error 1
Ns make failed!
Hi all,
When add some modules to ns-2 2.31 in ubantu 12.04 and before run the make file i have follow the above statement.
1. ./install
The below error is coming.
In file included from tools/random.h:42:0,
from tools/random.cc:41:
tools/rng.h:104:1: error: expected class-name before ‘{’ token
tools/rng.h:369:61: error: ‘FILE’ has not been declared
tools/random.cc:50:1: error: ‘RANDOM_RETURN_TYPE’ does not name a type
make: *** [tools/random.o] Error 1
Ns make failed!
Please help to remove the error
Thanks you !!!!
Try this, it worked for me.
Solution:
In otcl-1.13/configure, line number 5516
I want to recompile ns2 with crypto++ and cryptopp I perform this code
Code:
make distclean
export CPPFLAGS="$CPPFLAGS -I/usr/include/crypto++"
export LIBS="$LIBS -lssl -lcrypto -lcrypto++ -lcryptopp"
./configure --prefix=/usr/include 2>&1 | tee log.configure
cp -a Makefile Makefile.orig
sed 's;INCLUDES = \\;INCLUDES=${CPPFLAGS} \\;' Makefile.orig >Makefile
make all 2>&1 | tee log.make.all
But when I perform the last instruction I have this error
Code:
In file included from tools/random.h:42:0,
from tools/random.cc:41:
tools/rng.h:104:1: error: expected class-name before ‘{’ token
{
^
tools/rng.h:369:61: error: ‘FILE’ has not been declared
void first_n_mil(RNG::RNGSources source, long seed, int n, FILE *out);
^
tools/random.cc:50:1: error: ‘RANDOM_RETURN_TYPE’ does not name a type
RANDOM_RETURN_TYPE
^
make: *** [tools/random.o] Error 1
please can some one help me.
Thank you in advance.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.