I'm trying to implement chord in ns3 but I am having troubling getting the code that is already out there for it to run. I cloned the code from this repository:
http://code.nsnam.org/gillh/ns-3-chord/ but when I went to build it with ./waf (after using ./waf configure) it failed to build and gave me the following error:
Waf: Entering directory `/Users/Dekabal/Desktop/ns3workspace-chord/ns-allinone-3.19/ns-3.19/ns-3-chord/build'
[ 11/982] ns3header: src/core/log.h -> build/debug/ns3/log.h
[390/982] cxx: src/core/log.cc -> build/debug/src/core/log_1.o
[394/982] cxx: src/core/object-base.cc -> build/debug/src/core/object-base_1.o
[396/982] cxx: src/core/object.cc -> build/debug/src/core/object_1.o
[400/982] cxx: src/core/command-line.cc -> build/debug/src/core/command-line_1.o
[402/982] cxx: src/core/attribute.cc -> build/debug/src/core/attribute_1.o
[414/982] cxx: src/core/config.cc -> build/debug/src/core/config_1.o
[415/982] cxx: src/core/callback.cc -> build/debug/src/core/callback_1.o
[416/982] cxx: src/core/names.cc -> build/debug/src/core/names_1.o
In file included from ../src/core/callback.cc:42:
../src/core/log.h:339: error: typedef ‘ns3::ns3::LogTimePrinter’ is initialized (use __typeof__ instead)
../src/core/log.h:339: error: ‘ostream’ is not a member of ‘ns3::std’
../src/core/log.h:339: error: ‘os’ was not declared in this scope
../src/core/log.h:340: error: typedef ‘ns3::ns3::LogNodePrinter’ is initialized (use __typeof__ instead)
../src/core/log.h:340: error: ‘ostream’ is not a member of ‘ns3::std’
../src/core/log.h:340: error: ‘os’ was not declared in this scope
../src/core/log.h:342: error: variable or field ‘LogSetTimePrinter’ declared void
../src/core/log.h:342: error: ‘LogTimePrinter’ was not declared in this scope
../src/core/log.h:343: error: ‘LogTimePrinter’ does not name a type
../src/core/log.h:345: error: variable or field ‘LogSetNodePrinter’ declared void
../src/core/log.h:345: error: ‘LogNodePrinter’ was not declared in this scope
../src/core/log.h:346: error: ‘LogNodePrinter’ does not name a type
../src/core/log.h:364: error: expected class-name before ‘{’ token
../src/core/log.h:366: error: ISO C++ forbids declaration of ‘ostream’ with no type
../src/core/log.h:366: error: invalid use of ‘::’
../src/core/log.h:366: error: expected ‘;’ before ‘&’ token
../src/core/log.h:368: error: expected `)' before ‘&’ token
../src/core/log.h: In member function ‘ns3::ns3::ParameterLogger& ns3::ns3::ParameterLogger::operator<<(T)’:
../src/core/log.h:376: error: ‘m_os’ was not declared in this scope
../src/core/callback.cc: At global scope:
../src/core/callback.cc:44: error: ‘string’ in namespace ‘ns3::std’ does not name a type
[425/982] cxx: src/core/unix-system-thread.cc -> build/debug/src/core/unix-system-thread_1.o
Waf: Leaving directory `/Users/Dekabal/Desktop/ns3workspace-chord/ns-allinone-3.19/ns-3.19/ns-3-chord/build'
Build failed
-> task failed (err #1):
{task: cxx callback.cc -> callback_1.o}
The code that it is failing at initially looks like this:
namespace ns3 {
#include <iostream>
/**
* \ingroup logging
*
* Print the list of logging messages available.
* Same as running your program with the NS_LOG environment
* variable set as NS_LOG=print-list
*/
void LogComponentPrintList (void);
typedef void (*LogTimePrinter) (std::ostream &os);
typedef void (*LogNodePrinter) (std::ostream &os);
void LogSetTimePrinter (LogTimePrinter);
LogTimePrinter LogGetTimePrinter(void);
void LogSetNodePrinter (LogNodePrinter);
LogNodePrinter LogGetNodePrinter(void);
Does anyone have any idea about how to fix this or if it is fixable? My knowledge of c++ isn't that extensive and i've tried removing the namespace declarations and moving the offending lines out of the namespace but it causes he code to break in many of files instead of just log.h.