You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering a compilation issue when trying to build a project that includes the NS3 AI . The compiler is unable to find the ns3_ai_gym namespace, which should be generated from a protobuf file. Below is the error output when trying to compile with CMake and Ninja:
FAILED: contrib/ai/CMakeFiles/libai-obj.dir/model/gym-interface/cpp/ns3-ai-gym-interface.cc.o
/usr/bin/ccache /usr/bin/c++ -DEIGEN_MPL2_ONLY -DHAVE_EIGEN3 -DHAVE_GSL -DHAVE_LIBXML2 -DHAVE_SQLITE3 -DHAVE_STDINT_H -DNS3_ASSERT_ENABLE -DNS3_BUILD_PROFILE_DEBUG -DNS3_LOG_ENABLE -DPROJECT_SOURCE_PATH="/home/ji/ns-allinone-3.38/ns-3.38" -D__LINUX__ -I/usr -I/home/ji/ns-allinone-3.38/ns-3.38/build/include -I/usr/include/eigen3 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gtk-3.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/libxml2 -I/usr/include/python3.10 -g -fPIC -fno-semantic-interposition -fdiagnostics-color=always -Wall -Werror -Wno-error=deprecated-declarations -std=gnu++17 -Winvalid-pch -include /home/ji/ns-allinone-3.38/ns-3.38/cmake-build-debug/CMakeFiles/stdlib_pch-debug.dir/cmake_pch.hxx -MD -MT contrib/ai/CMakeFiles/libai-obj.dir/model/gym-interface/cpp/ns3-ai-gym-interface.cc.o -MF contrib/ai/CMakeFiles/libai-obj.dir/model/gym-interface/cpp/ns3-ai-gym-interface.cc.o.d -o contrib/ai/CMakeFiles/libai-obj.dir/model/gym-interface/cpp/ns3-ai-gym-interface.cc.o -c /home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc: In member function ‘void ns3::OpenGymInterface::Init()’:
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:89:5: error: ‘ns3_ai_gym’ has not been declared
89 | ns3_ai_gym::SimInitMsg simInitMsg;
| ^~~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:92:9: error: ‘ns3_ai_gym’ has not been declared
92 | ns3_ai_gym::SpaceDescription spaceDesc;
| ^~~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:93:9: error: ‘spaceDesc’ was not declared in this scope
93 | spaceDesc = obsSpace->GetSpaceDescription();
| ^~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:94:9: error: ‘simInitMsg’ was not declared in this scope
94 | simInitMsg.mutable_obsspace()->CopyFrom(spaceDesc);
| ^~~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:98:9: error: ‘ns3_ai_gym’ has not been declared
98 | ns3_ai_gym::SpaceDescription spaceDesc;
| ^~~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:99:9: error: ‘spaceDesc’ was not declared in this scope
99 | spaceDesc = actionSpace->GetSpaceDescription();
| ^~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:100:9: error: ‘simInitMsg’ was not declared in this scope
100 | simInitMsg.mutable_actspace()->CopyFrom(spaceDesc);
| ^~~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:109:45: error: ‘simInitMsg’ was not declared in this scope
109 | msgInterface->GetCpp2PyStruct()->size = simInitMsg.ByteSizeLong();
| ^~~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:116:5: error: ‘ns3_ai_gym’ has not been declared
116 | ns3_ai_gym::SimInitAck simInitAck;
| ^~~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:118:5: error: ‘simInitAck’ was not declared in this scope
118 | simInitAck.ParseFromArray(msgInterface->GetPy2CppStruct()->buffer,
| ^~~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc: In member function ‘void ns3::OpenGymInterface::NotifyCurrentState()’:
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:151:5: error: ‘ns3_ai_gym’ has not been declared
151 | ns3_ai_gym::EnvStateMsg envStateMsg;
| ^~~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:153:5: error: ‘ns3_ai_gym’ has not been declared
153 | ns3_ai_gym::DataContainer obsDataContainerPbMsg;
| ^~~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:156:9: error: ‘obsDataContainerPbMsg’ was not declared in this scope; did you mean ‘obsDataContainer’?
156 | obsDataContainerPbMsg = obsDataContainer->GetDataContainerPbMsg();
| ^~~~~~~~~~~~~~~~~~~~~
| obsDataContainer
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:157:9: error: ‘envStateMsg’ was not declared in this scope
157 | envStateMsg.mutable_obsdata()->CopyFrom(obsDataContainerPbMsg);
| ^~~~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:160:5: error: ‘envStateMsg’ was not declared in this scope
160 | envStateMsg.set_reward(reward);
| ^~~~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:168:36: error: ‘ns3_ai_gym’ has not been declared
168 | envStateMsg.set_reason(ns3_ai_gym::EnvStateMsg::SimulationEnd);
| ^~~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:172:36: error: ‘ns3_ai_gym’ has not been declared
172 | envStateMsg.set_reason(ns3_ai_gym::EnvStateMsg::GameOver);
| ^~~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:192:5: error: ‘ns3_ai_gym’ has not been declared
192 | ns3_ai_gym::EnvActMsg envActMsg;
| ^~~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:195:5: error: ‘envActMsg’ was not declared in this scope
195 | envActMsg.ParseFromArray(msgInterface->GetPy2CppStruct()->buffer,
| ^~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:216:5: error: ‘ns3_ai_gym’ has not been declared
216 | ns3_ai_gym::DataContainer actDataContainerPbMsg = envActMsg.actdata();
| ^~~~~~~~~~
/home/ji/ns-allinone-3.38/ns-3.38/contrib/ai/model/gym-interface/cpp/ns3-ai-gym-interface.cc:218:60: error: ‘actDataContainerPbMsg’ was not declared in this scope; did you mean ‘actDataContainer’?
218 | OpenGymDataContainer::CreateFromDataContainerPbMsg(actDataContainerPbMsg);
| ^~~~~~~~~~~~~~~~~~~~~
| actDataContainer
ninja: build stopped: subcommand failed.
I am using the following tools and versions:
Protobuf version: libprotoc 3.12.4
NS3 version: ns3.38
Operating System: ubuntu 22.04
Could you please help me identify what might be causing this issue and how to resolve it?
Thank you for your assistance.
The text was updated successfully, but these errors were encountered:
Hello,
I'm encountering a compilation issue when trying to build a project that includes the NS3 AI . The compiler is unable to find the ns3_ai_gym namespace, which should be generated from a protobuf file. Below is the error output when trying to compile with CMake and Ninja:
I am using the following tools and versions:
Protobuf version: libprotoc 3.12.4
NS3 version: ns3.38
Operating System: ubuntu 22.04
Could you please help me identify what might be causing this issue and how to resolve it?
Thank you for your assistance.
The text was updated successfully, but these errors were encountered: