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 #54

Open
bsuvonov opened this issue Apr 27, 2024 · 7 comments
Open

Compilation error #54

bsuvonov opened this issue Apr 27, 2024 · 7 comments

Comments

@bsuvonov
Copy link

Hi, I am using Ubuntu and getting the following error during compilation:

g++ -std=c++20  -O3 -g -o build/main.o -c src/main.cpp -Iinclude -I/usr/local/include -Iinclude/imgui
In file included from include/api.h:10,
                 from include/engine.h:1,
                 from src/main.cpp:1:
include/protos/api.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
   17 | #error This file was generated by an older version of protoc which is
      |  ^~~~~
include/protos/api.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
   18 | #error incompatible with your Protocol Buffer headers. Please
      |  ^~~~~
include/protos/api.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
   19 | #error regenerate this file with a newer version of protoc.
      |  ^~~~~
make: *** [makefile:36: build/main.o] Error 1

What could the issue be?

@collinalexbell
Copy link
Owner

Would you send me the result of

protoc --version

and

lsb_release -a ?

Thanks

@bsuvonov
Copy link
Author

bsuvonov commented Apr 28, 2024

@collinalexbell

The output for protoc --version:
libprotoc 3.20.3

Output for lsb_release -a:

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 23.10
Release:	23.10
Codename:	mantic

@collinalexbell
Copy link
Owner

Hmm maybe do an 'apt update' and 'sudo apt install protobuf-compiler'.

Then 'rm build/include/protos/*' and recompile.

@bsuvonov
Copy link
Author

bsuvonov commented Apr 28, 2024

I did as you said, compiler is installed, and there is no build/include/protos/, still getting the same error.

@collinalexbell
Copy link
Owner

collinalexbell commented Apr 28, 2024

Sorry. It is 'rm include/protos/*'

There is a version mismatch between the compiled proto header and the C++ library or something like that.

@bsuvonov
Copy link
Author

Ahh, I tried this too but still the same result

@collinalexbell
Copy link
Owner

This is a strange error because the project isn't mixing pre-compiled protobuf code with protobuf code compiled at buildtime. I don't know what other version it would be comparing to since the api.pb.h beams the only proto header in the project.

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

2 participants