LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   dsr/linkcache . fatal error : list.h No such file or directory (https://www.linuxquestions.org/questions/linux-newbie-8/dsr-linkcache-fatal-error-list-h-no-such-file-or-directory-4175555012/)

monasayed 10-01-2015 12:13 PM

dsr/linkcache . fatal error : list.h No such file or directory
 
How I can fix this error
dsr/linkcache.cc:56:18: fatal error: list.h: No such file or directory
compilation terminated.
I am using NS2.35 and ubuntu-12.04

knudfl 10-01-2015 02:00 PM

Welcome to LQ.


ns-2.35 : Right, linkcache.cc apparently wants to use the file list.h .
`list.h' is not present in a contemporary 'Linux OS'.

But I have never seen any errors caused by the missing `list.h'.
Hundreds of builds, many different OS`s, most g++ versions 4.4.4 ... 5.2.0 :
Always with the ./install command : No errors.
**** Please do not use ./configure, 'make' in ns-2.35 ....
The right command for ns235 is './install', in the top directory `ns-allinone-2.35/'.

No errors :
Probably why it hasn't been commented out long time ago.
You can do that with two times slash ( // ) :
// #include <list.h>
.... or you can simply delete the line.


? Any questions ?
Then please supply the essential information : The command causing the error.
. http://www.linuxquestions.org/linux/...Ask_a_Question
. http://www.catb.org/~esr/faqs/smart-questions.html



-

monasayed 10-02-2015 04:01 AM

make: *** [dsr/linkcache.o] Error 1 Ns make failed!
 
Quote:

Originally Posted by knudfl (Post 5428419)
Welcome to LQ.


ns-2.35 : Right, linkcache.cc apparently wants to use the file list.h .
`list.h' is not present in a contemporary 'Linux OS'.

But I have never seen any errors caused by the missing `list.h'.
Hundreds of builds, many different OS`s, most g++ versions 4.4.4 ... 5.2.0 :
Always with the ./install command : No errors.
**** Please do not use ./configure, 'make' in ns-2.35 ....
The right command for ns235 is './install', in the top directory `ns-allinone-2.35/'.

No errors :
Probably why it hasn't been commented out long time ago.
You can do that with two times slash ( // ) :
// #include <list.h>
.... or you can simply delete the line.


? Any questions ?
Then please supply the essential information : The command causing the error.
. http://www.linuxquestions.org/linux/...Ask_a_Question
. http://www.catb.org/~esr/faqs/smart-questions.html



-

I made // to #include<list.h> at linkcache. The follow message error appear

dsr/linkcache.cc:231:0: warning: "INFINITY" redefined [enabled by default]
./routing/route.h:47:0: note: this is the location of the previous definition
dsr/linkcache.cc:437:58: error: default argument given for parameter 3 of ‘bool LinkCache::findRoute(ID, Path&, int)’ [-fpermissive]
dsr/linkcache.cc:191:7: error: after previous specification in ‘virtual bool LinkCache::findRoute(ID, Path&, int)’ [-fpermissive]
make: *** [dsr/linkcache.o] Error 1
Ns make failed!

monasayed 10-02-2015 04:06 AM

I made // to #include <list.h> at linkcache . The following message error appear

dsr/linkcache.cc:231:0: warning: "INFINITY" redefined [enabled by default]
./routing/route.h:47:0: note: this is the location of the previous definition
dsr/linkcache.cc:437:58: error: default argument given for parameter 3 of bool LinkCache::findRoute(ID, Path&, int) [-fpermissive]
dsr/linkcache.cc:191:7: error: after previous specification in virtual bool LinkCache::findRoute(ID, Path&, int) [-fpermissive]
make: *** [dsr/linkcache.o] Error 1
Ns make failed!

knudfl 10-02-2015 05:17 AM

Repeat : Which command are you using ?


Besides that : Get an updated "ns-allinone-2.35" >> ns-allinone-2.35_gcc482.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
... Never seen any errors with that package.
Any gcc version 4.4.x .. 5.2.0 can be used.


** The old year 2011 ns-allinone-2.35 : The version -4.4 must be set ...
$ export CC=gcc-4.4 CXX=g++-4.4 && ./install


-

monasayed 10-02-2015 06:00 AM

First I made //#include <list.h> at linkcache then ./install at ns-allinone-2.35

knudfl 10-02-2015 06:08 AM

Re #5.

Ubuntu 12.04 :
$ sudo apt-get update
$ sudo apt-get install g++ g++-4.4 autoconf libtool libxmu-dev xgraph


Quote:

.... then ./install at ns-allinone-2.35
Please read post #5 : The command is not './install'.
But : 'export CC=gcc-4.4 CXX=g++-4.4 && ./install'.

Much better ,,, and may be the solution :
Start from scratch in a new directory (The Desktop/ cannot be used.)
And unpack a new ns-allinone-2.35 :
$ tar xvf ns-allinone-2.35_gcc482.tar.gz


-

monasayed 10-06-2015 04:43 PM

I downloaded NS2.35 from the link you have sent me and installed it with the above steps.
The DSR work with mobicache but when I change the cache type to linkcache then I executed the commands make clean ,, make depend ,, make then the following error appeared

dsr/linkcache.cc:56:18: fatal error: list.h: No such file or directory compilation terminated.
make: *** [dsr/linkcache.o] Error 1


Then I did // to #include<list.h> at linkcache. Then make clean ,, make depend ,, make
The following message error appeared

dsr/linkcache.cc: In member function virtual int LinkCache::command(int, const char* const*):
dsr/linkcache.cc:310:15: warning: deprecated conversion from string constant to char* [-Wwrite-strings]
dsr/linkcache.cc: At global scope:
dsr/linkcache.cc:437:58: error: default argument given for parameter 3 of bool LinkCache::findRoute(ID, Path&, int) [-fpermissive]
dsr/linkcache.cc:191:7: error: after previous specification in virtual bool LinkCache::findRoute(ID, Path&, int) [-fpermissive]
dsr/linkcache.cc: In member function void LinkCache::dump_dijkstra(int):
dsr/linkcache.cc:728:18: warning: deprecated conversion from string constant to char* [-Wwrite-strings]
dsr/linkcache.cc: In member function void LinkCache::dumpLink():
dsr/linkcache.cc:875:18: warning: deprecated conversion from string constant to char* [-Wwrite-strings]
make: *** [dsr/linkcache.o] Error 1

monasayed 10-07-2015 02:49 AM

I run the command ./install, in the top directory ns-allinone-2.35
There is the error meesage

dsr/linkcache.cc:231:0: warning: "INFINITY" redefined [enabled by default]
./routing/route.h:47:0: note: this is the location of the previous definition
dsr/linkcache.cc:437:58: error: default argument given for parameter 3 of bool LinkCache::findRoute(ID, Path&, int) [-fpermissive]
dsr/linkcache.cc:191:7: error: after previous specification in virtual bool LinkCache::findRoute(ID, Path&, int) [-fpermissive]
make: *** [dsr/linkcache.o] Error 1
Ns make failed!

knudfl 10-07-2015 03:44 AM

Re #8, #9
Quote:

The DSR work with mobicache but when I change the cache type to linkcache
? Which file was edited ?

Example : You edited xxx.cc, then delete xxx.o , to avoid 'making clean'.

And : Do never use 'make depend' !
'make depend' was executed with the ./install command. Not required more than once.

Conclusion : Delete the one object (file.o), from the file.cc you edited.
And delete 'ns'. Run 'make', to compile the edited file, and to link a new 'ns'.


-

monasayed 10-08-2015 01:22 PM

I need to change the type of cache at DSR from mobicache to linkcache. I edited mobicache.cc file by removing // from #ifdef DSR_MOBICACHE and I edited linkcache.cc by adding // to #ifdef DSR_LINKCACHE , so the code of mobicache is not compiled, this leaves linkcache as the only available cache.
note:
I'm sorry but I didn't clearly understand what you meant by delete 'ns'.

knudfl 10-08-2015 02:36 PM

Re #11.

If you have a successful build you get ns-2.35/ns
.. That's is your executable 'ns'.
Can be deleted if you want to link a new 'ns' with your new mobicache.o

.... Is simpler than 'make clean' :
You don't have to compile all ~400 files.cc, just one : mobicache.cc >> mobicache.o

monasayed 10-08-2015 03:03 PM

Thank you I understand now
But still my problem exist
When I type locate list.h at terminal this directory appear
/usr/src/linux-headers-3.2.0-29/include/linux/list.h

is there any method to make the file linkcache.cc see this directory?

knudfl 10-08-2015 04:12 PM

Re #13.

You can try copying `/usr/src/linux-headers-3.2.0-29/include/linux/list.h'
.. to ns-2.35/common/ ,,, then headers are usually found.

( And may be change #include <list.h>
.. to #include "list.h" ,,, if it isn't found in common/.)


-

monasayed 10-12-2015 01:03 PM

I copied list.h to ns-allinone-2.35/ns-2.35/common and then made make. This error appear

In file included from dsr/linkcache.cc:56:0:
./common/list.h:6:26: fatal error: linux/poison.h: No such file or directory compilation terminated.

Then I copied the file poison.h to ns-allinone-2.35/ns-2.35/common but again this error appear

In file included from dsr/linkcache.cc:56:0:
./common/list.h:6:26: fatal error: linux/poison.h: No such file or directory compilation terminated.


All times are GMT -5. The time now is 08:35 PM.