Hi everyone.
I try to build mesh-net work on ns3.26.
But it isn't work.
I think it is bad to code.
Thank you.
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Undefined symbols for architecture x86_64:
"MeshDot11sSim::RunSim(int, char**)", referenced from:
_main in exp06-simpleMesh.cc.14.o
"MeshDot11sSim::MeshDot11sSim()", referenced from:
_main in exp06-simpleMesh.cc.14.o
"vtable for MeshDot11sSim", referenced from:
MeshDot11sSim::~MeshDot11sSim() in exp06-simpleMesh.cc.14.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
12 int main (int argc, char *argv[])
13 {
14 MeshDot11sSim sim;
15 ns3::PacketMetadata::Enable ();
16
17 sim.RunSim(argc, argv);
18
19 return 0;
20 }
-----code(simpleMeshLib.h)-----
class MeshDot11sSim
{
public:
// Init test
MeshDot11sSim ();
//private:
uint32_t m_xSize; //x size of the grid
uint32_t m_ySize; //y size of the grid
double m_step; //separation between nodes
double m_randomStart;
double m_totalTime;
uint16_t m_packetSize;
uint32_t m_nIfaces;
bool m_chan;
std::string m_txrate;
std::string m_root;
bool m_showRtable;
//to calculate the lenght of the simulation
float m_timeTotal, m_timeStart, m_timeEnd;
// List of network nodes
NodeContainer meshNodes;
NodeContainer staNodes;
Ptr<Node> *n;
Ptr<Node> bgr;
// List of all mesh point devices
NetDeviceContainer meshDevices;
NetDeviceContainer p2pDevices;
// MeshHelper. Report is not static methods
MeshHelper mesh;
//private:
// Run test
virtual void RunSim (int argc, char **argv);
// Configure test from command line arguments
virtual void Configure (int argc, char ** argv);
// Create nodes and setup their mobility
-----code(simpleMeshLib.cc)-----
void
MeshDot11sSim::RunSim (int argc, char *argv[])
{
NS_LOG_FUNCTION(this);
Configure (argc, argv);
// use ConfigStore
// following default configuration are same to
// ./waf --run "exp06-simpleMesh --ns3::ConfigStore::Mode=Save
// --ns3::ConfigStore::Filename=config.txt"
std::string cf = std::string(PROG_DIR) + "config.txt";
Config::SetDefault ("ns3::ConfigStore::Filename", StringValue (cf));
Config::SetDefault ("ns3::ConfigStore::FileFormat", StringValue ("RawText"));
Config::SetDefault ("ns3::ConfigStore::Mode", StringValue ("Save"));
ConfigStore config;
config.ConfigureDefaults ();
CreateTopologyNodes ();
ConfigureMeshLayer();
InstallInternetStack ();
//SetUpUdpApplication();