#ifndef CLASS_VEHICLE_
#define CLASS_VEHICLE_
#include "ns3/ptr.h"
#include "ns3/object.h"
#include "ns3/vector.h"
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/mobility-module.h"
#include "ns3/config-store-module.h"
#include "ns3/wifi-module.h"
#include "Cluster.h"
namespace ns3
{
class Cluster;
/// define type DeviceTraceCallback
typedef Callback<void, Ptr<Vehicle>, std::string, Ptr<const Packet> > DeviceTraceCallback; // Line where the error is
/// define type VehicleReceiveCallback.
typedef Callback<void, Ptr<Vehicle>, Ptr<const Packet>, Address> VehicleReceiveCallback;
/// define type PhyRxOkTraceCallback.
typedef Callback<void, Ptr<Vehicle>, std::string, Ptr<const Packet>, double, WifiMode, enum WifiPreamble> PhyRxOkTraceCallback;
/// define type PhyRxErrorTraceCallback.
typedef Callback<void, Ptr<Vehicle>, std::string, Ptr<const Packet>, double> PhyRxErrorTraceCallback;
/// define type PhyTxTraceCallback.
typedef Callback<void, Ptr<Vehicle>, std::string, Ptr<const Packet>, WifiMode, WifiPreamble, uint8_t> PhyTxTraceCallback;
/// define type PhyStateTraceCallback.
typedef Callback<void, Ptr<Vehicle>, std::string, Time, Time, enum WifiPhy::State> PhyStateTraceCallback;
class Vehicle : public ns3::Object
{
... code section
};
};
#endif
私はns3に取り組んでおり、車両ネットワークに関するシミュレーションを実行できるコードを実装する必要があります。私はいくつかのクラスを持っていますが、1つだけが迷惑です。実際、コンパイルすると、この特定のエラーが発生します。
"/src/vanet/model/Vehicle.h:45:エラー:'DeviceTraceCallback'の前の無効な宣言子"
そしてそれは他のたくさんのエラーをもたらします
"/src/vanet/model/Vehicle.h:212:エラー:'DeviceTraceCallback'はタイプに名前を付けていません"
また
"../src/vanet/model/Vehicle.h:214:エラー:'DeviceTraceCallback'が宣言されていません"。
私は自分が何を間違えたのか本当に理解していないので、誰かが私を助けてくれるならそれはとてもいいことです!