tkn-tub / ns3-gym

ns3-gym - The Playground for Reinforcement Learning in Networking Research
GNU General Public License v2.0
524 stars 198 forks source link

protobuf messages are generated but could not be found during build configuration #76

Closed PennyXQZ closed 1 year ago

PennyXQZ commented 1 year ago

During the build progress,

I can see that the files messages.pb.cc and messages.pb.h files are build in path: build/include/model path/*,

and file messages_pb2.py is built in path: contrib/opengym/model/ns3gym/ns3gym/model/*.

However, I meet the error during the build command that:

`[ 27%] Running cpp protocol buffer compiler on model/messages.proto Scanning dependencies of target libopengym-obj

[ 27%] Building CXX object contrib/opengym/CMakeFiles/libopengym-obj.dir/helper/opengym-helper.cc.o

[ 27%] Building CXX object contrib/opengym/CMakeFiles/libopengym-obj.dir/model/container.cc.o In file included from /home/ubuntu/ns-3-dev/contrib/opengym/model/container.cc:23: /home/ubuntu/ns-3-dev/contrib/opengym/model/container.h:27:10: fatal error: messages.pb.h: No such file or directory 27 | #include "messages.pb.h" | ^~~~~~~

compilation terminated.

make[2]: *** [contrib/opengym/CMakeFiles/libopengym-obj.dir/build.make:93: contrib/opengym/CMakeFiles/libopengym-obj.dir/model/container.cc.o] Error 1

make[1]: *** [CMakeFiles/Makefile2:5563: contrib/opengym/CMakeFiles/libopengym-obj.dir/all] Error 2

make[1]: *** Waiting for unfinished jobs....

[ 27%] Building CXX object src/flow-monitor/CMakeFiles/libflow-monitor-obj.dir/model/flow-probe.cc.o ` I think the built messages.pb.h could not be found. How could I solve this problem? Many thanks!

PennyXQZ commented 1 year ago

I solved this problem by modifying: 27 | #include "messages.pb.h" to 27 | #include "model/messages.pb.h" in container.cc and the problem is solved. Thanks!