LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 05-10-2013, 09:10 AM   #1
dina
LQ Newbie
 
Registered: Oct 2012
Posts: 23

Rep: Reputation: Disabled
an error with #include <tcl.h>


I have problem in compiling vectorbasedforward.cc routing protocol in aqua-sim package over ns-2.30 for underwater wireless sensor network. I have ubuntu 10.10. The problem is when I compile any .cc have (#include <tcl.h>) as:
Code:
dina@dina-Satellite-L635:~/aqua-sim/ns-2.30/underwatersensor/uw_routing$ gcc vectorbasedforward.cc
vectorbasedforward.cc:7: fatal error: tcl.h: No such file or directory
compilation terminated.
what is missing in my package??
 
Old 05-10-2013, 09:13 AM   #2
dina
LQ Newbie
 
Registered: Oct 2012
Posts: 23

Original Poster
Rep: Reputation: Disabled
Also, i tried g++:
Code:
dina@dina-Satellite-L635:~/aqua-sim/ns-2.30/underwatersensor/uw_routing$ g++ vectorbasedforward.cc
vectorbasedforward.cc:7: fatal error: tcl.h: No such file or directory
compilation terminated.
 
Old 05-10-2013, 11:47 AM   #3
dina
LQ Newbie
 
Registered: Oct 2012
Posts: 23

Original Poster
Rep: Reputation: Disabled
i have just downloaded the file "tcl-devel-8.4.7-4.el4.i386.rpm" which contains:
/usr/include/tcl.h
/usr/lib
/usr/share
and i need to copy these file in my /usr/include and ....
but this operation is denied???why??
if this step is true?how can i import these files???
 
Old 05-12-2013, 07:48 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Ns2 files.cc files cannot be compiled seperately.

Tcl / tcl.h : Is present in the "tcl8.4.13/" supplied with ns-2.30.

Recompiling 'vectorbasedforward.cc' :
$ cd ns-2.30/underwatersensor/uw_routing/ && rm *.o && exit
$ cd ns-2.30/ && make

.
 
Old 05-12-2013, 01:08 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
"tcl-devel-8.4.7-4.el4.i386.rpm"
a rpm

but your icon under your name is Ubuntu
ubuntu dose not use red hat RPM's let alone a now (mostly) dead rhel4 rpm

normally on modern OS's in the /usr/include folder tcl is in
/usr/include/Tcl/tcl.h
the folder in include is needed
#include <Tcl/tcl.h>

and or update ld
 
Old 05-13-2013, 02:11 PM   #6
dina
LQ Newbie
 
Registered: Oct 2012
Posts: 23

Original Poster
Rep: Reputation: Disabled
i followed these steps
Quote:
Originally Posted by knudfl View Post
$ cd ns-2.30/underwatersensor/uw_routing/ && rm *.o && exit
$ cd ns-2.30/ && make
.
but, still the error
Code:
dina@dina-Satellite-L635:~/aqua-sim/ns-2.30/underwatersensor/uw_routing$ g++ vectorbasedforward.cc
vectorbasedforward.cc:7: fatal error: tcl.h: No such file or directory
compilation terminated.
do i remove the *.o files in the "uw_routing" folder only? or in all the "underwatersensor" folder, too?
 
Old 05-13-2013, 02:28 PM   #7
dina
LQ Newbie
 
Registered: Oct 2012
Posts: 23

Original Poster
Rep: Reputation: Disabled
First, thanks for your explaination
Quote:
Originally Posted by John VV View Post
"tcl-devel-8.4.7-4.el4.i386.rpm"
but when i search for tcl.h in my usr/include/ i found the following:
Code:
dina@dina-Satellite-L635:/usr/include$ cd tcl8.4
dina@dina-Satellite-L635:/usr/include/tcl8.4$ ls
tclDecls.h  tclPlatDecls.h  tkDecls.h  tkPlatDecls.h
tcl.h       tcl-private     tk.h       tk-private
So that, i modify this in the vectorbasedforward.cc as:
#include <tcl8.4/tcl.h>
the error is solved, but still all the other paths
Code:
dina@dina-Satellite-L635:~/aqua-sim/ns-2.30/underwatersensor/uw_routing$ g++ vectorbasedforward.cc
vectorbasedforward.cc:8: fatal error: underwatersensor/uw_mac/underwaterchannel.h: No such file or directory
compilation terminated.
i will try to complete all the next errors by modifying the paths and i will tell you the result
Finally, what does it mean:
[QOUTE]update ld[/QOUTE]
 
Old 05-13-2013, 02:38 PM   #8
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
One way you might be able to deal with this is by modifying the CFLAGS directive in the make file.
(I'm assuming there is only one makefile, and not a netsted group of them).

The CFLAGS current assignments gets "-I/usr/include/tcl8.4" added on.

This should cause the makefile to use it for every "cc $CFLAGS ..." entry.
 
Old 05-13-2013, 04:08 PM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 7 .
Quote:
error: underwatersensor/uw_mac/underwaterchannel.h: No such file or directory
underwaterchannel.h : Should be found if you didn't change anything.

Other files.h : The Makefile takes care of those. With a path.
If you move (or rename) an ns-allinone to a different location,
you will often have to start from scratch.
Or move the ns-allinone back to the original location.

"ns-2.30/Makefile" INCLUDES :
Line 65: -I/home/name//ns-allinone-2.30/tclcl-1.18 \
-I/home/name//ns-allinone-2.30/otcl \
-I/home/name//ns-allinone-2.30/include ( This is the one with tcl.h )
etc. etc. lines 66 - 73.

-

Last edited by knudfl; 05-13-2013 at 04:11 PM.
 
Old 05-13-2013, 04:43 PM   #10
dina
LQ Newbie
 
Registered: Oct 2012
Posts: 23

Original Poster
Rep: Reputation: Disabled
i didn't make any changes in underwaterchannel.h
Quote:
Originally Posted by knudfl View Post
# 7 .
"ns-2.30/Makefile" INCLUDES :
Line 65: -I/home/name//ns-allinone-2.30/tclcl-1.18 \
-I/home/name//ns-allinone-2.30/otcl \
-I/home/name//ns-allinone-2.30/include ( This is the one with tcl.h )
etc. etc. lines 66 - 73.

-
when i open home/dina/aqua-sim/ns-2.30/Makefile as you mentioned above i found:
INCLUDES = \
-I. \
-I/home/dina/aqua-sim/tclcl-1.18 -I/home/dina/aqua-sim/otcl-1.12 -I/home/dina/aqua-sim/include -I/home/dina/aqua-sim/include -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

As you see, i installed "aqua-sim" which support underwater sensor network not "ns-allinone-2.30" What can i do???
 
Old 05-14-2013, 02:41 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 10 .

The package http://www.engr.uconn.edu/~yiz09005/Aqua-Sim-1.0.tgz
is a renamed ns-allinone-2.30 patched with aquasim.
The naming makes no difference.
To reset the odd behavior you can use the ./install in the top directory.
Or start from scratch in a new directory, and include your modification.
Then run $ export CC=gcc41 CXX=g++41 && ./install .

Two things : Do not add any path text to .bashrc .
And : The 'ns' executable can be renamed to be recognizable :
Like $ mv ns ns-aqua , etc.

-
 
Old 05-25-2013, 04:09 PM   #12
dina
LQ Newbie
 
Registered: Oct 2012
Posts: 23

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
"ns-2.30/Makefile" INCLUDES :
Line 65: -I/home/name//ns-allinone-2.30/tclcl-1.18 \
-I/home/name//ns-allinone-2.30/otcl \
-I/home/name//ns-allinone-2.30/include ( This is the one with tcl.h )
etc. etc. lines 66 - 73.

-
this is the INCLUDE in my makefile:
INCLUDES = \
-I. \
-I/home/dina/aqua-sim/tclcl-1.18 -I/home/dina/aqua-sim/otcl -I/home/dina/aqua-sim/include -I/home/dina/aqua-sim/include -I/usr/include/pcap \
-I./home/dina/aqua-sim/tclcl-1.18 -I./home/dina/aqua-sim/otcl -I./home/dina/aqua-sim/include -I./home/dina/aqua-sim/include -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./underwatersensor/uw_tcl \
-I./underwatersensor/uw_routing \
-I./wpan
is there any missing or errors???
the error not solved:
Code:
dina@dina-Satellite-L635:~/aqua-sim/ns-2.30/underwatersensor/uw_routing$ g++ vectorbasedforward.cc 
vectorbasedforward.cc:7: fatal error: tcl.h: No such file or directory
compilation terminated.
dina@dina-Satellite-L635:~/aqua-sim/ns-2.30/underwatersensor/uw_routing$
does the error caused by putting . as:
-I./home/dina/aqua-sim/tclcl-1.18 -I./home/dina/aqua-sim/otcl -I./home/dina/aqua-sim/include -I./home/dina/aqua-sim/include -I./usr/include/pcap \

or what???
Thanks
 
Old 05-25-2013, 04:47 PM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 12 .

Yes. "-I./home/dina/aqua-sim/tclcl-1.18 -I./home/dina/aqua-sim/otcl -I./home/dina/aqua-sim/include -I./home/dina/aqua-sim/include -I./usr/include/pcap "
... is wrong. ! The period ( . ) means the current directory !

Solution : Start from scratch in a new directory,
with a new unpacked Aqua-Sim-1.0.tgz.
Make the changes, and use "./install" for the build.

-
 
Old 05-25-2013, 04:58 PM   #14
dina
LQ Newbie
 
Registered: Oct 2012
Posts: 23

Original Poster
Rep: Reputation: Disabled
Thanks for your quick reply
Quote:
Originally Posted by knudfl View Post
# 12 .
Solution : Start from scratch in a new directory,
with a new unpacked Aqua-Sim-1.0.tgz.
Make the changes, and use "./install" for the build.
-
before start from scratch, do i uninstall the old version?
if yes, how can i do that?
 
Old 05-26-2013, 03:35 AM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 14 .

Removing / deleting <Aquasim> :
Delete the folder with the content from Aqua-Sim-1.0.tgz .

And delete any text added to .bashrc :
And don't add anything for the new install. Not required by a Linux OS.

And by the way : You can have as many versions of ns-allinone as you want,
installed at the same time.

-
 
  


Reply

Tags
aquasim, 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
Little error (not harmful) exists in tcl.SlackBuild (source slackbuilds for Tcl) blancamolinos Slackware 3 01-14-2013 05:46 AM
NS-2 TCL error while simulation Marz22 Linux - Newbie 2 11-22-2011 03:49 AM
tcl.h error immortaltechnique Linux - Newbie 2 01-16-2007 08:30 AM
tcl error ! wizex Debian 3 09-05-2005 03:21 PM
tcl/tk: Bwidget error Onemessedupjedi Programming 0 07-05-2004 05:24 PM

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

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