NS2 Error in SunOS 5.8

For me, troubleshooting is an art.

Today, I try to troubleshoot an error related with my NS2 installation in SunOS 5.8. It was about include and library things error. First error that I got was that libstdc++.so.10 couldn’t be found.

ld.so.1: ./tcl2c++: fatal: libstdc++.so.2.10.0: open failed: No such file or directory

Since operating system never lies, then it must be true that the file couldn’t be found indeed. I tried to look for the file which later I found it to be in /usr/local/lib . It is there though, but why the installation can’t find it? I tried to see my shell’s environment information and crap, there is no data about where to look for library.

After exporting the LD_LIBRARY_PATH to the environment variable, there is no more complaining about libstdc++.so.10 . And for our information, most of [library can’t be found error] can be solved by observing whether your shell search the library in the proper location or not. Of course, if you haven’t installed it, then that must be the source of the problem. But, if you have installed the library, and still the installation complains about it, first thing first, look at your library path environment.

I thought it was over. But, another error appeared. It said that “directory ‘queue’ specified in #include” and the compiling process stopped. Looking deeper, I realized that the error was in the ns-2.32 installation. I browsed the web to search for solution, but I couldn’t found any of it.

g++ -c -O2 -Wall -DTCP_DELAY_BIND_ALL -DNO_TK -DTCLCL_CLASSINSTVAR -DNDEBUG -D__svr4__ -DSOLARIS_MIN_MAX -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_13 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCL_H -DHAVE_CONFIG_H -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=none -DUSE_SINGLE_ADDRESS_SPACE -Drng_test -I. -I/home/reza/ns-allinone-2.31/tclcl-1.19 -I/home/reza/ns-allinone-2.31/otcl-1.13 -I/home/reza/ns-allinone-2.31/include -I/home/reza/ns-allinone-2.31/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 -o packmime/packmime_HTTP.o packmime/packmime_HTTP.cc
In file included from packmime/packmime_HTTP.cc:48:
packmime/packmime_HTTP.h:53: directory `queue’ specified in #include
make: *** [packmime/packmime_HTTP.o] Error 1

I have to find the solution myself.

First, I looked at the file stated in the error (packmime_HTTP.h). In line 53 , this is the text.

#include <queue>

I don’t know much about coding, or the rules for #include in programming, but by literally translate the error, it means that somehow this ‘queue’ things was regarded as ‘directory’ and since it is regarded as ‘directory’, it can’t be used as those #include parameter. I tried to find information about what is the rule of #include in c++ file, but it didn’t help.

Later, I realized that this -I. and this -I./queue in the g++ parameter means it will include all the header files inside the directory queue and the current directory (the ns-2.32/ directory). It was clear for me that this queue inclusion become the problem. If I omit this queue lookup, there must be error because some files that need the header in this directory won’t be compiled correctly.

But, what if I only omit this queue directory lookup when building packmime_HTTP.cc ? What if this packmime.cc needs some files under queue directory ? Doing some trick, I copied the file needed for it into another directory (mcast/). It won’t be a problem since mcast/ is in the include parameter.

I compiled only one file, packmime_HTTP.cc, since if I compiled it all along, with the default install method, the queue exclusion will be a problem for another file. I omit the -I.queue/. However, there is still an error appeared. I think, the -I directives will also “see” that there is a directory named queue. Then, since it is only a compilation of one file, I rename queue directory to be queue2, so that the -I directives doesn’t “see” any directory named queue. I ran the script once again, and voila, it worked. It produced the packmime_HTTP.o .

g++ -c -O2 -Wall -DTCP_DELAY_BIND_ALL -DNO_TK -DTCLCL_CLASSINSTVAR -DNDEBUG -D__svr4__ -DSOLARIS_MIN_MAX -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_13 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCL_H -DHAVE_CONFIG_H -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=none -DUSE_SINGLE_ADDRESS_SPACE -Drng_test -I. -I/home/reza/ns-allinone-2.31/tclcl-1.19 -I/home/reza/ns-allinone-2.31/otcl-1.13 -I/home/reza/ns-allinone-2.31/include -I/home/reza/ns-allinone-2.31/include -I/usr/include/pcap -I./tcp -I./sctp -I./common -I./link -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 -o packmime/packmime_HTTP.o packmime/packmime_HTTP.cc

After that, I have to compile another ns-2.32 source code. I renamed first queue2 into queue (since I am finished with the packmime_HTTP error) and the compilation went very smoothly. Since the packmime_HTTP has been compiled individually, the make command didn’t compile it again, which is good. And, after that, I deleted the part of ns-2.32 installation in the NS2-allinone default install file (the name is “install” in the top directory of ns-allinone). Running this install once again to completely finish with nam,tclcl,otcl,and another software in ns2-allinone package.

Some minutes later, after almost one day of troubleshooting (I didn’t go to the lab today for some reason), finally, I could install ns2 in ‘my’ Sun)S 5.8. Alhamdulillah…

Some lesson that I wanna share to you about my story above are :

1. When it comes to library lookup error, be sure to check your environment variable for library lookup parameter.
2. Do not give up when you troubleshoot something. If you can’t find the solution in the internet, keep on working in your error.
3. Look at some important files like Makefile, the install script that you run, etc, to find any ideas about the error. Usually, error in compilation comes with the name of suspected file and its line which produces error. Look at it carefully. And start troubleshooting right away.

p.s.: I definitely understand that the above solution is tricky, and a little bit strange. I think, there must be another logical and official solution for that. However, for me, whatever the solution is, whether it is according to the rule or not, when it comes to that kind of things (in my local language, “ngoprek”), it is okay. What is important for me in this things is to get it works.


9 Responses to “NS2 Error in SunOS 5.8”

  1. November 7, 2007 pukul 2:34 pm

    ngeri juga ya, udah maenan network simulator.
    sakti emang.


  2. November 8, 2007 pukul 12:08 pm

    Ck ck ck..
    You are the real ‘oprek-er’!!!
    NS2, NS2,… I didn’t remember anymore… πŸ™‚
    How if you compare with our “comp. network” subject in ITB?

  3. 3 Putri
    November 9, 2007 pukul 10:04 pm

    Am;pun, Rez…
    Yang beginian saya nggak ikud2an…
    Mana sanggup saya??!! =(

  4. 4 adebayu
    November 10, 2007 pukul 1:24 am

    I get inspiration from your lesson.
    I just make equivalent of the solution. Just like thevenin-norton theorem.

    In my problem:
    1. When it comes to understanding error, be sure to check her mood parameter.
    2. Do not give up when you troubleshoot her. If you can’t find the solution in the internet, keep on working in your error.
    3. Look at some important stuff like doll, flower, budget, the poem script that you create, etc, to find any ideas about her error. Usually, error in relationship comes with the kind of suspected attitude and its line which produces error. Look at it carefully. And start troubleshooting right away.

    I think, your stuff is more difficult that finding the meaning of love ^_^ (Sastra Jenar Book Chap. 10 verse 19)

  5. November 10, 2007 pukul 1:43 am

    walah bob, baru aja install, belum main nih.. ngeri situ lah kk πŸ˜€

    i didn’t have any computer network related class here, ri.. so, sadly, i have to figure it out myself how to oprek ns2.. maybe next semester there will be more class..

    waduh.. ada mahasiswa komunikasi nyasar ke postingan elektro-related nih πŸ˜€ hehehe…

    your comment was exactly what i expect from master of love like you, De πŸ˜€ ..
    logically correct though..
    sadly, she can’t be compiled many times..
    once you are failed to compile it, it may be okay.. but the second attempt you try to rebuild it, be careful not to do wrong things..
    there may not be a third opportunity for us..

  6. November 11, 2007 pukul 2:44 pm

    halah, pak, pak… adoh2 nang jepang dolanane ns2 πŸ˜€

    tapi nang SunOS ya, dudu cygwin maneh :p

  7. November 13, 2007 pukul 8:49 am

    iyo maw, rodo sesek sih, tapi piye maneh πŸ˜€

  8. 8 nur
    Januari 30, 2008 pukul 6:03 pm


    how could you documented all those lines of coding and just talked about them like you talked about sightseeing or another trip to an elementary school??

    who are you, really?

  9. 9 Alim
    Desember 7, 2008 pukul 1:30 pm

    hi there,
    I was just looking for how to solve this problem out and stopped by your page.
    Thanks a lot for all that effort. It saved my day.

    a modification I might add..

    It seems that there’s no need to remove “-I.” and “-I.queue/” while you are compiling the target code for packmime_HTTP.cc. Just copying queue.h and renaming the folder work well.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s

%d blogger menyukai ini: