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 08-15-2010, 06:50 AM   #1
bilalPolito
LQ Newbie
 
Registered: Aug 2010
Posts: 2

Rep: Reputation: 0
ns-allinone-2.31 make: *** [tools/random.o] Error 127


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?

thanks
 
Old 08-15-2010, 12:20 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.4 + 50+ other Linux OS, for test only.
Posts: 16,744

Rep: Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319
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.
..
Attached Files
File Type: txt diff-Makefile.in-Makefile.txt (2.1 KB, 109 views)
 
1 members found this post helpful.
Old 08-17-2010, 12:21 PM   #3
bilalPolito
LQ Newbie
 
Registered: Aug 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Question Not solved

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 View Post
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.
..
 
Old 08-18-2010, 11:35 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.4 + 50+ other Linux OS, for test only.
Posts: 16,744

Rep: Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319
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.
..
 
1 members found this post helpful.
Old 07-18-2013, 12:51 AM   #5
Soumenkanrar
LQ Newbie
 
Registered: Jul 2013
Posts: 2

Rep: Reputation: Disabled
Ns2- 2.31 ( Ubantu 12.04)

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-18-2013 at 12:53 AM.
 
Old 07-18-2013, 01:24 AM   #6
Soumenkanrar
LQ Newbie
 
Registered: Jul 2013
Posts: 2

Rep: Reputation: Disabled
Ns2- 2.31 ( Ubantu 12.04) make: *** [tools/random.o] Error 1

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 !!!!
 
Old 07-18-2013, 07:28 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.4 + 50+ other Linux OS, for test only.
Posts: 16,744

Rep: Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319Reputation: 3319
Post # 6, @Soumenkanrar : Welcome to LQ.
Quote:
1. ./install
Not a valid command. The compiler must be set in the "install" command.

Example : $ export CC=gcc41 CXX=g++41 && ./install

The 32bits gcc/g++ version 4.1.2 for the 32bits (i686) Ubuntu 12.04,
post # 47 here ..
http://www.linuxquestions.org/questi...532/page4.html

This command will show if you have `i686` or `x86_64` OS: $ uname -m

-
 
Old 08-15-2013, 10:39 AM   #8
ty00016
LQ Newbie
 
Registered: Jul 2013
Posts: 2

Rep: Reputation: Disabled
solve "make: *** [libotcl.so] Error 1"

Quote:
Originally Posted by Soumenkanrar View Post
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

-SHLIB_LD="ld -shared"
+SHLIB_LD="gcc -shared"

You can google "install ns2.31 ubuntu 12.04" and find the link below.
http://ramakrishnamundugar.blogspot....untu-1204.html

My question is I want to add a few lines in the Makefile, but it is read-only. Anyone knows this? Thank you very much!

Regards,
Ting
 
Old 02-05-2015, 09:25 AM   #9
salwa
Member
 
Registered: Dec 2014
Posts: 36

Rep: Reputation: Disabled
Hi sirs,

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.
 
  


Reply

Tags
ns2, ns231


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
How can I resolve this error: make: *** [HelloWorld.o] error 127 for Eclipse C++ ? drcshavers Red Hat 4 06-05-2010 11:32 AM
Unable to compile C++ programs.make:g++ command not found error.Error 127 PrathuD Programming 3 03-16-2009 01:44 PM
make: *** [primer.o] Error 127 Insomnia6 Linux - Newbie 1 12-16-2008 11:49 AM
module-init-tools-3.1 error 127 Homer Glemkin Linux - Software 0 11-23-2004 12:11 PM
make: cc: command not found make: *** [gzip.o]error 127 zyjk Linux - Newbie 5 02-08-2002 10:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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