首页 > 其他分享 >【原创】ns3 + sumo + ns3gym编译冲突解决方案

【原创】ns3 + sumo + ns3gym编译冲突解决方案

时间:2024-10-11 21:44:35浏览次数:1  
标签:google const protobuf sumo include ns3gym ns3 name

Copyright (c) 2024, China,Henan Univercity of Science and Technology
河南科技大学,中国

在搞ndnSIM当毕业设计,ns3 + ndnsim + sumo + ns3-gym编译存在冲突:

                 from ../contrib/ndn4ivc/apps/fgfxf-rsu.cc:25:
./ns3/sumo-TraCIConstants.h:328:21: error: expected identifier before numeric constant
 #define TYPE_DOUBLE 0x0B
                     ^
./ns3/sumo-TraCIConstants.h:328:21: error: expected ‘}’ before numeric constant
./ns3/sumo-TraCIConstants.h:328:21: error: expected unqualified-id before numeric constant
In file included from /usr/include/google/protobuf/message.h:122:0,
                 from ./ns3/messages.pb.h:26,
                 from ./ns3/spaces.h:26,
                 from ./ns3/fgfxf-rsu.h:36,
                 from ../contrib/ndn4ivc/apps/fgfxf-rsu.cc:26:
/usr/include/google/protobuf/descriptor.h:512:24: error: non-member function ‘const string& google::protobuf::name()’ cannot have cv-qualifier
   const string& name() const;        // Name of this field within the message.
                        ^~~~~
/usr/include/google/protobuf/descriptor.h:513:29: error: non-member function ‘const string& google::protobuf::full_name()’ cannot have cv-qualifier
   const string& full_name() const;   // Fully-qualified name of the field.
                             ^~~~~
/usr/include/google/protobuf/descriptor.h:514:29: error: non-member function ‘const string& google::protobuf::json_name()’ cannot have cv-qualifier
   const string& json_name() const;   // JSON name of this field.
                             ^~~~~
/usr/include/google/protobuf/descriptor.h:515:32: error: non-member function ‘const google::protobuf::FileDescriptor* google::protobuf::file()’ cannot have cv-qualifier

解决方案:
先引入sumo,再引入ns3-gym。并解决冲突预定义。

#include"ns3/traci-client.h"
#undef TYPE_DOUBLE
#undef TYPE_STRING
#include"ns3/opengym_interface.h"

请称我为最强!

标签:google,const,protobuf,sumo,include,ns3gym,ns3,name
From: https://www.cnblogs.com/coolfan/p/18459422

相关文章

  • 虚拟机启动后ens33处于DOWN状态,无法远程连接
    平时用于学习和测试,在本地通过VMware部署了Ubuntu服务器,并配置了静态IP,方便远程连接。在某次启动虚拟机后,发现无法通过SSH连接。用ipaddr查看,发现ens33处于DOWN状态root@shawn-virtual-machine:~#ipaddr1:lo:<LOOPBACK,UP,LOWER_UP>mtu65536qdiscnoqueuestateUNKNOW......
  • Rocky9怎么把网卡名由ens33修改为eth0
    环境查看```系统环境#cat/etc/redhat-releaseRockyLinuxrelease9.3(BlueOnyx)#uname-aLinuxRockyTemplete5.14.0-362.18.1.el9_3.0.1.x86_64#1SMPPREEMPT_DYNAMICSunFeb1113:49:23UTC2024x86_64x86_64x86_64GNU/Linux修改配置文件修改以下配......
  • vm虚拟机linux系统(openEuler)中ens33没有ip地址
    xshell连接虚拟机时,使用ipaddress发现显示如下,ens33没有IP地址解决方案1、检查Linux虚拟机的网络连接模式,确保它是NAT模式。2、在VMwareworkstation里,点击菜单栏上的【编辑】–>【虚拟网络编辑器】,打开下方的虚拟网络编辑器。选择VMnet8(NAT模式),取消勾选【使用本地DHC......
  • Astra-sim 1.0_ns3编译问题
    目前github上的Astra-sim1.0_ns3的子模块地址出错了,修改.gitmodules,应为:[submodule"extern/googletest"]path=extern/googletesturl=https://github.com/google/googletest.git[submodule"extern/network_backend/analytical"]path=extern/network_backe......
  • CentOS7 虚拟机 ens33网卡失效
    之前虚拟机ssh连接没问题,今天竟然连不上了。打开虚拟机ipa网卡ens33没有iproot@ubuntu:~/Desktop#ipa1:lo:<LOOPBACK,UP,LOWER_UP>mtu65536qdiscnoqueuestateUNKNOWNgroupdefaultqlen1000link/loopback00:00:00:00:00:00brd00:00:00:00:00:00inet1......
  • 8、linux安装orace11g报[FATAL][INS32035]无法在指定位置创建新产品清单
    目录linux安装orace11g报·[FATAL]·[INS32035]无法在指定位置创建新产品清单1、执行静默安装命令后报错:提示如下2、解决方案:3、重新执行静默安装命令linux安装orace11g报·[FATAL]·[INS32035]无法在指定位置创建新产品清单1、执行静默安装命令后报错:提示如下正在启动Oracle......
  • 从零开始 使用OMNET++结合VEINS,INET和SUMO的联合仿真
    背景知识当我们探索未来的交通系统和智能交通解决方案时,车辆到一切(Vehicle-to-Everything,V2X)通信技术显得尤为重要。V2X是指在车辆与车辆(V2V)、车辆与基础设施(V2I)、车辆与行人(V2P)以及车辆与网络(V2N)之间进行的通信。这种技术能够提高道路安全,优化交通流量,减少拥堵,提升驾驶体验......
  • GNS3打开工程报错 --Dynamips error xxx:unable to create UDP NIO 解决方法
    GNS3打开工程报错--Dynamipserrorwhenrunningcommandxxx:unabletocreateUDPNIO报错原因:GNS3(v2.2)serverUDP连接端口号使用了10000-20000,NvidiaGeForceExperience也使用了相同的UDP端口号,发生冲突。解决方法:方法一:卸载NvidiaGeForceExperience,此过程不会......
  • 解决centos7修改网卡名为eth0仍显示ens33的问题
    1.进入/etc/sysconfig/network-scripts修改网卡配置文件中的DEVICE=与NAME=参数为eth0保存退出后再修改网卡配置文件名mvifcfg-ens33ifcfg-eth02.重新生成grub2文件编辑/etc/default/grub配置文件,在GRUB_CMDLINE_LINUX这个参数后面加入:net.ifnames=0biosdevnam......
  • 解决VMware 虚拟机 ubuntu 20.04 异常关闭导致虚拟网卡 ens33 无法工作问题
    问题描述由于经常使用SSH远程链接VMware中的虚拟机ubuntu,每次关闭都是挂起,时间久了,虚拟机运行有些卡顿了,此时可以通过Linux命令重启或者关闭ubuntu,也可以之间使用VMWare中的【虚拟机】--【电源】->【关闭客户机】强行关闭正在运行的虚拟机但是这个强行关闭正在运行的......