Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation Error #1

Open
PhKindermann opened this issue Jun 29, 2024 · 1 comment
Open

Compilation Error #1

PhKindermann opened this issue Jun 29, 2024 · 1 comment

Comments

@PhKindermann
Copy link

Hey,

I tried to compile your program, but I'm getting errors. First, I got a huge list of errors (I have a 800kb file that I can send you, if you want). I got rid of most of them by setting CMAKE_CXX_STANDARD to 17 in CMakeLists.txt, but one error remains:

[ 83%] Building CXX object CMakeFiles/OCM.dir/home/philipp/2024-pace-submissions/heuristic/13-kongqi/pace-2024-pace-2024/Test/TestCoreOCM.cpp.o
In file included from /home/philipp/2024-pace-submissions/heuristic/13-kongqi/pace-2024-pace-2024/Test/TestCoreOCM.cpp:14:
/home/philipp/2024-pace-submissions/heuristic/13-kongqi/pace-2024-pace-2024/Build/Linux/../../GOAL/ThirdParty/Protobuf.h: In function ‘std::string goal::protobufToJson(const T&, bool)’:
/home/philipp/2024-pace-submissions/heuristic/13-kongqi/pace-2024-pace-2024/Build/Linux/../../GOAL/ThirdParty/Protobuf.h:37:13: error: ‘using JsonPrintOptions = struct google::protobuf::json::PrintOptions’ {aka ‘struct google::protobuf::json::PrintOptions’} has no member named ‘always_print_primitive_fields’
   37 |     options.always_print_primitive_fields = true;
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/OCM.dir/build.make:132: CMakeFiles/OCM.dir/home/philipp/2024-pace-submissions/heuristic/13-kongqi/pace-2024-pace-2024/Test/TestCoreOCM.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/OCM.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Do you have any idea what I can do to fix this error? I'm using Ubuntu 22.04 LTS.

Best
Philipp

@PhKindermann
Copy link
Author

OK, I got it to work, following this issue of another project that had the same problem: rizsotto/Bear#566

In GOAL/ThirdParty/Protobuf.h, I replaced line 37

options.always_print_primitive_fields = true;

by

#if GOOGLE_PROTOBUF_VERSION < 5026000
    options.always_print_primitive_fields = true;
#endif

Together with the change in CMakeLists.txt outlined above, I could now compile the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant