Problems With "error: Invalid Conversion From `const Char*' To `char*' "

Hi, I need some help. I tried to install obs-ns. It΄s based on ns2, but when I ran "make", the problem below appears... please I wish anybody would help me.


This is the error:

Code:
OBS/ns-2/integrated_agent.h: In constructor `BurstManager::BurstManager()':
OBS/ns-2/integrated_agent.h:86: warning: `BurstManager::bt_' will be initialized after
OBS/ns-2/integrated_agent.h:84: warning:   `int BurstManager::currburstsize_'
OBS/ns-2/integrated_agent.cc:66: warning:   when initialized here
OBS/ns-2/integrated_agent.cc: In member function `int BurstManager::nhops(nsaddr_t, nsaddr_t)':
OBS/ns-2/integrated_agent.cc:81: error: invalid conversion from `const char*' to `char*'   <------- this is the error 
OBS/ns-2/integrated_agent.cc: In member function `virtual void IPKTAgent::recv(Packet*, Handler*)':
OBS/ns-2/integrated_agent.cc:180: warning: unused variable 'ipkth'
/root/OBS/ns-allinone-2.31/tclcl-1.19/tclcl.h:150: error: `void Tcl::error(const char*)' is private
OBS/ns-2/integrated_agent.cc:185: error: within this context
OBS/ns-2/integrated_agent.cc:155: warning: unused variable 'hdr'
OBS/ns-2/integrated_agent.cc: In member function `void IPKTAgent::deBurst(Packet*)':
OBS/ns-2/integrated_agent.cc:192: warning: unused variable 'hdrip'
OBS/ns-2/integrated_agent.cc:194: warning: unused variable 'ch'
make: *** [OBS/ns-2/integrated_agent.o] Error 1


And this is the code of the program...


Code:
int BurstManager::nhops(nsaddr_t src,nsaddr_t des) {
  Tcl& tcl = Tcl::instance();
  sprintf(tcl.buffer(),"$ns nhops %d %d",src,des);
  tcl.eval();
  char *ni = tcl.result();   <------this is the line 81 
  return atoi(ni);
}



Similar Content



Cannot Say Hello To The World Due To 'code 1'

/************************************************************
*
* Project 0: My First Program in C++
*
* Author: xxx xxxx
* Date: 18 January 2015
*
* This is the canonical first program for C++.
* Its purpose is to show that one knows how to create a program in
* one's particular programming environment.
*
************************************************************/

#include <bjarne/std_lib_facilities.h>

int main()
{
cout << "Hello, world!\n";

return 0;
}

I compiled the hello world program as my prof instructed.
then I used C+c C+c, delete 'make -k' and replaced with 'g++ -o proj0 -std=c++11 proj0.cc', choose to save the file, and it goes 'compilation exited abnormally with code 1'

note that I do all these by making SSH connection with computer in lab with a linux system

FYI, the whole thing is:

-*- mode: compilation; default-directory: "~/private/cs1/proj0/" -*-
Compilation started at Sun Jan 18 21:15:54

g++ -o proj0 -std=c++11 proj0.cc
In file included from /usr/include/c++/4.9.2/locale:41:0,
from /usr/include/c++/4.9.2/iomanip:43,
from /usr/local/include/bjarne/std_lib_facilities.h:220,
from proj0.cc:14:
/usr/include/c++/4.9.2/bits/locale_facets_nonio.h:1869:5: error: template-id do_get<> for String std::messages<char>::do_get(std::messages_base::catalog, int, int, const String&) const does not match any template declaration
messages<char>::do_get(catalog, int, int, const string&) const;
^
/usr/include/c++/4.9.2/bits/locale_facets_nonio.h:1869:62: note: saw 1 template<> , need 2 for specializing a member function template
messages<char>::do_get(catalog, int, int, const string&) const;
^

Compilation exited abnormally with code 1 at Sun Jan 18 21:15:55

Replace Lines Matching A Pattern

I have several files in that I need to add the text "N CHAR(1)," How can I accomplish this in linux without having to do it manually. Thanks

HAVE

nullcols
(A "to_number(:A,'9')"
,B CHAR(50)
)

WANT

nullcols
(N CHAR(1)
,A "to_number(:A,'9')"
,B CHAR(50)
)

Erreur When Install Ns2.34

Hi , i desinstall ns2.34 and i want to reinstall again so i was follow your step
$ tar xvf ns-allinone-2.34.tar.gz
$ cd ns-allinone-2.34/
$ patch -p0 < lwx+LTE+dccp+MPTCP.patch
$ export CC=gcc41 CXX=g++41 && ./install

and with this patch i add another patch for wimax "wimax-awg26_ns235.patch"

but when i install ns2.34 this erreur was showen
common/packet.h: In static member function β€˜static void p_info::initName()’:
common/packet.h:402: error: β€˜PT_WIMAXBS’ was not declared in this scope
make: *** [common/scheduler.o] Error 1
Ns make failed!

can you tell me where is the problem ???

After Install Gpsr, Test The Perimeter Mode , It Has Throw "Wrong The Other Node"

hello there!
the common communication between nodes is fine, but when i want to test the perimeter mode it has throw the error "Wrong the other node", it seems that it couldn't find its next hop node.
i trace the code as show below
Code:
int
GPSRNeighbors::intersect(nsaddr_t theother, double sx, double sy,
			 double dx, double dy){
  //line 1 (x1,y1)--(x2,y2) is the segment
  //line 2 (x3,y3)--(x4,y4) is the xD 
  struct gpsr_neighbor *other = getnb(theother);

  if(other==NULL){
    printf("Wrong the other node\n");
    exit(1);
  }


  ****************

struct gpsr_neighbor*
GPSRNeighbors::getnb(nsaddr_t nid){
  struct gpsr_neighbor *temp = head_;
  while(temp){
    if(temp->id_ == nid){
      if((GPSR_CURRENT - temp->ts_) < DEFAULT_GPSR_TIMEOUT)
	return temp;
      else {
	delnb(temp); //if this entry expire, delete it and return NULL
	return NULL;
      }
      return temp;
    }
    temp = temp->next_;
  }
  return NULL;
}

the simulation scene was shown in the attachment.
when i make node 0 send packet to node 1, the error will occur.
would somebody know how to solve it?
thank you for your time!

Check Empty Variable Without Comments

Hello,

They gave me this:
Code:
#!/bin/bash

# Write error message on stderr and die
function die() {
  echo "$@" >&2
  exit 1
}

# Load var from properties files
function load() {
  for propertie in "$@" ; do
    [[ -f "${propertie}" ]] || die "load() : \"${propertie}\" don't exist !"
    while read ; do
echo "${REPLY%=*}"
echo "${REPLY#*=}"
      [[ -n "${REPLY%%=*}" && -z "${REPLY#*=}" ]] || die "load() : Variable \"${REPLY%%=*}\" is empty!"
      eval "${REPLY%%=*}"=\'"${REPLY#*=}"\'
    done < "${propertie}"
  done
}

load "manage_srcds.conf"
echo "SRCDS_TICKRATE=$SRCDS_TICKRATE"
echo "SRCDS_SCREEN=$SRCDS_SCREEN"
echo "SRCDS_SRCDS_GAME_NAME=$SRCDS_GAME_NAME"
echo "SRCDS_MAXPLAYERS=$SRCDS_MAXPLAYERS"

but, return:
Quote:
###################################################
###################################################
load() : Variable "###################################################" is empty!

cat manage_srcds.conf

I just wish that there was no empty variable excluding those who do not have integer.

Best regards,

Zrp Integration

Hiii.. i am going to integrate the zrp in ns2.35 and facing the error.... plz help me to remove this error....


trace/cmu-trace.o: In function `hdr_zrp::access(Packet const*)':
cmu-trace.cc.text._ZN7hdr_zrp6accessEPK6Packet[hdr_zrp::access(Packet const*)]+0x7): undefined reference to `hdr_zrp:ffset_'
collect2: ld returned 1 exit status
make: *** [ns] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Urgently Plz Reply Error In The Code

Helllo,
I defined the variable like this : set interval [lindex $argv 1].
When i execute my code, i got this error :



can't read "interval": no such variable
while executing
"$cbr_ set interval_ $interval"
(file "te.tcl" line 597)



How can i read this variable



Plz replyyy

Problem With Honeyd Installation During "make" In Kali Linux

Hello there,
First of all thank you for making me a part of this forum.
Secondly, here is the problem..
I am facing this problem in honeyd installation during "make"

root@kali:~/Desktop/Narayan/honeyd-1.5c# sudo make
make all-recursive
make[1]: Entering directory `/root/Desktop/Narayan/honeyd-1.5c'
Making all in .
make[2]: Entering directory `/root/Desktop/Narayan/honeyd-1.5c'
gcc -DHAVE_CONFIG_H -I. -I. -I. -I./ -I./compat -I/usr/local/include -I/usr/local/include -I/usr/local/include -O2 -Wall -g -DPATH_HONEYDINCLUDE="\"/usr/local/include/honeyd\"" -DPATH_HONEYDDATA="\"/usr/local/share/honeyd\"" -DPATH_HONEYDLIB="\"/usr/local/lib/honeyd\"" -DHONEYD_PLUGINS_DECLARE="" -DHONEYD_PLUGINS="" -DPATH_RRDTOOL="\"\"" -c honeyd.c
In file included from honeyd.c:97:0:
tagging.h:89:6: error: expected declaration specifiers or ‘...’ before ‘(’ token
tagging.h:89:6: error: expected declaration specifiers or ‘...’ before ‘(’ token
In file included from stats.h:36:0,
from honeyd.c:98:
./compat/sha1.h:23:3: warning: ‘__bounded__’ attribute directive ignored [-Wattributes]
./compat/sha1.h:23:3: warning: ‘__bounded__’ attribute directive ignored [-Wattributes]
./compat/sha1.h:26:3: warning: ‘__bounded__’ attribute directive ignored [-Wattributes]
./compat/sha1.h:28:3: warning: ‘__bounded__’ attribute directive ignored [-Wattributes]
./compat/sha1.h:30:3: warning: ‘__bounded__’ attribute directive ignored [-Wattributes]
./compat/sha1.h:32:3: warning: ‘__bounded__’ attribute directive ignored [-Wattributes]
./compat/sha1.h:35:3: warning: ‘__bounded__’ attribute directive ignored [-Wattributes]
./compat/sha1.h:35:3: warning: ‘__bounded__’ attribute directive ignored [-Wattributes]
make[2]: *** [honeyd.o] Error 1
make[2]: Leaving directory `/root/Desktop/Narayan/honeyd-1.5c'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/Desktop/Narayan/honeyd-1.5c'
make: *** [all] Error 2

I found a similar thread in this forum as well to solve the above problem by using "apt-get install honeyd" but didnt quite worked for me.

root@kali:~/Desktop/Narayan/honeyd-1.5c# apt-get install honeyd
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package honeyd


I tried researching but couldnt find any solutions. Moreover, I am really a newbie at Kali Linux and other debians as well.
I would appreciate if somone could help me.
Thank you.

Error In A Variable

Hi,
Someone could help me with these sentence?
Code:
per=`print "scale=2; $sum/$count" | bc`

It says me:
Code:
(standard_in) 1: parse error

Why?

Age Calculator, Pass By Reference Problem.

Hi, fellow programmers.
I am programming about an age calculator.
It's simple:
1, get the input date 'today', check if its valid
2, get the input date 'birthday', check if it's valid and before 'today'
3, calculate the difference and output.
This is a assignment due tomorrow and I have written the most of it, just needs some debugging, mostly about pass by reference. I declared date1&date2 at main and I have no idea how to call the value of them if I want to calculate them at another function. I guess I should probably declare them at struct Date, but I am not sure.
I would really appreciate it if you guys could tell me what to do.
Code:
/************************************************************
 *
 * Project 4: How Old Are You Really?
 *
 * Author: xx
 * Date: 6 May 2015
 *
 * This is a program designed to calculates the difference 
 * between two dates, which will be expressed in terms of
 * years, months and days.
 *
 ***********************************************************/

#include <bjarne/std_lib_facilities.h>

struct Date {
    int month;
    int day;
    int year;
// Member functions
Date get_date();
Date get_birth_date();
bool is_valid_date(int year, int month, int day);
bool is_before(Date& date1, Date& date2);
Date calculate_age(Date& date1,Date& date2);
};

// Declaration
Date get_date();
Date get_birth_date();
bool is_valid_date(int year, int month, int day);
bool is_before(Date& date1, Date& date2);
Date calculate_age(Date& date1,Date& date2);

int main()
{
    Date date1 = get_date();
    Date date2 = get_birth_date();
    Date get_date();
    // Check if the date is correct
    if (! is_valid_date(year, month, day))
    error("Date is not valid.");
    // Run how old or not?
    char go_on;
    cout << "Would you like to see how old you are (y/n)?\n";
    cin >> go_on;
    if (go_on=='n'){
    cout << "You are so chicken!";
    return 0;}
    else if (go_on!='y')
    error("Please enter y for yes or n for no.");
    Date get_birth_date();
    // Is birthday valid as well?
    if (! is_valid_date(int year, int month, int day))
    error("Date is not valid.");
    // Is the birthday before 'today'?
    if (!(is_before(Date& date1, Date& date2)))
    error("Your birthday should not be later than today, terminator.");
    // Calculate and give the answer.
    Date calculate_age();
}

Date get_date()
{
    Date date1;
    cout << "Welcome to the age calculator!\n";
    cout << "Please enter today's date (mm/dd/yyyy): ";
    int m;
    int d;
    int y;
    // To ignore the '/' during reading
    char slash;
    cin >> m;
    date1.month = m;
    cin >> slash;
    cin >> d;
    date1.day = d;
    cin >> slash;
    cin >> y;
    date1.year = y;
    cout << "Date entered was "<< date1.month << "/" << date1.day << "/" << date1.year <<"\n";
}

Date get_birth_date()
{
    Date date2;
    cout << "Please enter your birth date (mm/dd/yyyy): "; 
    int m;
    int d;
    int y;
    // To ignore the '/' during reading
    char slash;
    cin >> m;
    date2.month = m;
    cin >> slash;
    cin >> d;
    date2.day = d;
    cin >> slash;
    cin >> y;
    date2.year = y;
    cout << "Your birthday is "<< date2.month << "/" << date2.day << "/" << date2.year <<"\n";
}

// Is date valid?
bool is_vaild_date(int year, int month, int day)
{
    if (day<0)
    return false;
    if (month<1 || month>12)
    return false;
    // Check if the date exists or not considering there are have
    // different days when month varies
    int days_in_month=31;
    switch (month){
    case 2:
    days_in_month=28;
    break;
    case 4: case 6: case 9: case 11:
    days_in_month=30;
    break;
    }
    if (days_in_month<day)
    return false;
    return true;
}

//Date check - is birthday before 'today'?
bool is_before(Date& date1, Date& date2)
{
    if (Date& date1.year<Date& date2.year)
    return false;
    else if (Date& date1.month<Date& date2.month)
    return false;
    else if (Date& date1.day< Date& date2.day)
    return false;
    return true;
}

// Calculation
Date calculate_age(Date& date1,Date& date2)
{
    Date date3;
    date3.day = date1.day - date2.day;
    date3.month = date1.month - date2.month;
    date3.year = date1.year - date2.month;
    if (date3.day<0){
        date3.day = 30 + date3.day;
        date3.month = date3.month - 1;
    }
    if (date3.month<0){
        date3.month = 12 + date3.day;
        date3.year = date3.year - 1;
    }
    cout <<"You are " << date3.year <<" years, "<< date3.month <<" months, and " << date3.day <<" days old.\n";
}