Erlend's Lookout Post

Concerning ns-2, Ubuntu and other stuff.

Compiling threshold.cc

with 8 comments

threshold.cc is a program to calculate the thresholds for transmission receipt using the relation between various physical parameters (distance, effect, propagation model etc.) related to transmissions in ns-2. It has to be compiled by the user. This is not a difficult task, but could pose some challenges as the compiler over time is updated and no longer accepts the outdated c-code of outdated versions of ns-2.

Trying to do g++ threshold.cc will break if trying this with a reasonably updated version of Ubuntu and the g++ compiler (v4.3.3) in combination with ns-2.33. Thus, to make it work, delete the line that reads
#include <iostream.h>

and write these three lines there instead:
#include <iostream>
#include <cstring>
using namespace std;

Then try to compile with g++ again:
g++ threshold.cc -o threshold

Advertisement

Written by Erlend

Tuesday, July 21, 2009 at 11:32

Posted in ns-2

8 Responses

Subscribe to comments with RSS.

  1. Thanks! It works perfectly! Been looking what’s wrong with it, unable to compile (very bad in programming lang. to understand).

    =)

    Stella

    Monday, May 31, 2010 at 15:04

  2. Thanks! It works perfectly! Been looking what’s wrong with it, unable to compile.

    I wish everything good for you.

    =)

    Rafael

    Thursday, July 22, 2010 at 22:42

  3. nice post
    thanks… very useful information

    ariel

    Monday, December 6, 2010 at 20:23

  4. helped! Thank you!

    Elis

    Wednesday, December 8, 2010 at 10:23

  5. Your post is very useful for me.Thank you!!!!

    kokila

    Sunday, February 20, 2011 at 4:50

  6. Excellent post!
    Helped me a lot!

    []‘s

    Clederson

    Tuesday, March 1, 2011 at 4:16

  7. Thanks, now it works!

    Alysson Oliveira

    Saturday, June 25, 2011 at 19:12


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.