NS2's make recompile is not working.

Asked 2 years ago, Updated 2 years ago, 136 views

We have deployed ns-2 in ubuntu 16.04 to set up sample programming.Sample sources include tcl files and C++ files

ALM_app.h, ALM_app.cc
ALMtree.h, ALMtree.cc
ALM_con.h, ALM_con.cc
ALMData.h, ALMData.cc
ALM_params.h

is available.

However, I get a lot of errors like the following when I recompile using the make command.

~/ns-allinone-2.34/ns-2.34$make
    Short for short
    Infile included from myworkspace/ALM_app.h:7:0,
                     from myworkspace/ALM_app.cc:4:
    myworkspace/ALMtree.h:28:1:warning: 'typedef' was ignored in this declaration
     };
     ^
    Infile included from myworkspace/ALM_app.h:8:0,
                     from myworkspace/ALM_app.cc:4:
    myworkspace/ALM_con.h: Indicator 'ALMDataBuf::~ALMDataBuf()':
    myworkspace/ALM_con.h:21:11:warning:possible problem detected in invocation of delete operator: [-Wdelete-incomplete]
        delete data_;
               ^
    myworkspace/ALM_con.h:21:11:warning: invalid use of incomplete type 'class ALMData'
    myworkspace/ALM_con.h:9:7:note:forward declaration of 'class ALMData'
     class ALMData;
     
    Short for short

    myworkspace/ALM_app.cc:Inmember function'Node* 
    ALMApp::search_newP()':
    myworkspace/ALM_app.cc:2952:1: warning: control reach end of non-void function [-Wreturn-type]
    }
    ^
    myworkspace/ALM_app.cc: Member function'ALMData 
    ALMApp::createetempMessage(ALMData, int)':
    myworkspace/ALM_app.cc:3329:1:warning:control reach end of non-void 
    function [-Wreturn-type]
    }
    ^
    Makefile:93: Recipe failed for target 'myworkspace/ALM_app.o'
    make:*** [myworkspace/ALM_app.o] Error 1
    ~/ns-allinone-2.34/ns-2.34$

Could you tell me how to resolve this error?Thank you for your cooperation.

In order to set up these files, the method of setting up is specified below.
  

  Place the entire source file in the 1.ns-2.34 directory
    Add the following to the Makefile.in file in the 2.ns-2.34 directory:

         Short for short
        wpan/p802_15_4nam.owpan/p802_15_4phy.o\
        wpan/p802_15_4sscs.owpan/p802_15_4timer.o\
        wpan/p802_15_4trace.owpan/p802_15_4transac.o\
        myworkspace/ALM_app.o\< - Additional lines
        myworkspace/ALMtree.o\< - Additional lines
        myworkspace/ALM_con.o\< - Additional lines
        myworkspace/ALMData.o\< - Additional lines
        apps/pbc.o\
         Short for short
      It is written about the 328th line.

    3. Recompile NS2. Run the following command in the ns-2.34 directory:
       # ./configure 
       # make clean 
       # madepend 
       # make ← error
       # make install

ubuntu unix

2022-09-30 21:37

2 Answers

For example, /myworkspace/ALM_app.cc:2952:1:warning:control reach end of non-void function [-Wreturn-type] 」 is
[Direct translation: Non-void function, but it ran to the end of the code (without returning the value)] (The program may not be working properly because there is no return value.)
The description and the code where the error occurred (per line 2952 of the file myworkspace/ALM_app.cc) are shown, so please refer to them to modify the program.

There is a problem with the program in the file, so you can leave it unattended and no matter how much you change the setup, it will not work properly.

If you want specific advice, I think it would be better to add the program that is causing the problem to the question.
Few programmers know how to fix a program that doesn't know what code it is.


2022-09-30 21:37

This error was caused by a file that was not in the same folder as the C++ file.


2022-09-30 21:37

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.