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

MSVC 2022 compile error #647

Open
hexabyte23 opened this issue Jan 19, 2025 · 2 comments
Open

MSVC 2022 compile error #647

hexabyte23 opened this issue Jan 19, 2025 · 2 comments

Comments

@hexabyte23
Copy link

hexabyte23 commented Jan 19, 2025

Hi all,

Trying to compile C++ protobuf classes with MSVC 2022 Community, get this :

....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1299): error C2143: syntax error: missing ')' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1299): error C2143: syntax error: missing ';' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1299): error C2789: 'meshtastic::ModuleConfig_SerialConfig::DWORD': an object of const-qualified type must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1299): note: see declaration of 'meshtastic::ModuleConfig_SerialConfig::DWORD'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1299): error C2059: syntax error: ')'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1299): error C2238: unexpected token(s) preceding ';'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1300): error C2143: syntax error: missing ')' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1300): error C2143: syntax error: missing ';' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1300): error C2737: 'meshtastic::ModuleConfig_SerialConfig::DWORD': constexpr object must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1300): error C2789: 'meshtastic::ModuleConfig_SerialConfig::DWORD': an object of const-qualified type must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1300): note: see declaration of 'meshtastic::ModuleConfig_SerialConfig::DWORD'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1300): error C2059: syntax error: ')'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1300): error C2238: unexpected token(s) preceding ';'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1301): error C2143: syntax error: missing ')' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1301): error C2143: syntax error: missing ';' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1301): error C2737: 'meshtastic::ModuleConfig_SerialConfig::DWORD': constexpr object must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1301): error C2789: 'meshtastic::ModuleConfig_SerialConfig::DWORD': an object of const-qualified type must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1301): note: see declaration of 'meshtastic::ModuleConfig_SerialConfig::DWORD'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1301): error C2059: syntax error: ')'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1301): error C2238: unexpected token(s) preceding ';'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1302): error C2143: syntax error: missing ')' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1302): error C2143: syntax error: missing ';' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1302): error C2737: 'meshtastic::ModuleConfig_SerialConfig::DWORD': constexpr object must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1302): error C2789: 'meshtastic::ModuleConfig_SerialConfig::DWORD': an object of const-qualified type must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1302): note: see declaration of 'meshtastic::ModuleConfig_SerialConfig::DWORD'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1302): error C2059: syntax error: ')'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1302): error C2238: unexpected token(s) preceding ';'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1303): error C2143: syntax error: missing ')' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1303): error C2143: syntax error: missing ';' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1303): error C2737: 'meshtastic::ModuleConfig_SerialConfig::DWORD': constexpr object must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1303): error C2789: 'meshtastic::ModuleConfig_SerialConfig::DWORD': an object of const-qualified type must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1303): note: see declaration of 'meshtastic::ModuleConfig_SerialConfig::DWORD'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1303): error C2059: syntax error: ')'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1303): error C2238: unexpected token(s) preceding ';'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1304): error C2143: syntax error: missing ')' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1304): error C2143: syntax error: missing ';' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1304): error C2737: 'meshtastic::ModuleConfig_SerialConfig::DWORD': constexpr object must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1304): error C2789: 'meshtastic::ModuleConfig_SerialConfig::DWORD': an object of const-qualified type must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1304): note: see declaration of 'meshtastic::ModuleConfig_SerialConfig::DWORD'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1304): error C2059: syntax error: ')'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1304): error C2238: unexpected token(s) preceding ';'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1305): error C2143: syntax error: missing ')' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1305): error C2143: syntax error: missing ';' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1305): error C2737: 'meshtastic::ModuleConfig_SerialConfig::DWORD': constexpr object must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1305): error C2789: 'meshtastic::ModuleConfig_SerialConfig::DWORD': an object of const-qualified type must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1305): note: see declaration of 'meshtastic::ModuleConfig_SerialConfig::DWORD'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1305): error C2059: syntax error: ')'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1305): error C2238: unexpected token(s) preceding ';'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1306): error C2143: syntax error: missing ')' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1306): error C2143: syntax error: missing ';' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1306): error C2737: 'meshtastic::ModuleConfig_SerialConfig::DWORD': constexpr object must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1306): error C2789: 'meshtastic::ModuleConfig_SerialConfig::DWORD': an object of const-qualified type must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1306): note: see declaration of 'meshtastic::ModuleConfig_SerialConfig::DWORD'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1306): error C2059: syntax error: ')'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1306): error C2238: unexpected token(s) preceding ';'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1307): error C2143: syntax error: missing ')' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1307): error C2143: syntax error: missing ';' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1307): error C2737: 'meshtastic::ModuleConfig_SerialConfig::DWORD': constexpr object must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1307): error C2789: 'meshtastic::ModuleConfig_SerialConfig::DWORD': an object of const-qualified type must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1307): note: see declaration of 'meshtastic::ModuleConfig_SerialConfig::DWORD'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1307): error C2059: syntax error: ')'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1307): error C2238: unexpected token(s) preceding ';'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1308): error C2143: syntax error: missing ')' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1308): error C2143: syntax error: missing ';' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1308): error C2737: 'meshtastic::ModuleConfig_SerialConfig::DWORD': constexpr object must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1308): error C2789: 'meshtastic::ModuleConfig_SerialConfig::DWORD': an object of const-qualified type must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1308): note: see declaration of 'meshtastic::ModuleConfig_SerialConfig::DWORD'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1308): error C2059: syntax error: ')'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1308): error C2238: unexpected token(s) preceding ';'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1309): error C2143: syntax error: missing ')' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1309): error C2143: syntax error: missing ';' before 'constant'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1309): error C2737: 'meshtastic::ModuleConfig_SerialConfig::DWORD': constexpr object must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1309): error C2789: 'meshtastic::ModuleConfig_SerialConfig::DWORD': an object of const-qualified type must be initialized
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1309): note: see declaration of 'meshtastic::ModuleConfig_SerialConfig::DWORD'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1309): error C2059: syntax error: ')'
....\thirdparty\Meshtastic\generated\meshtastic/module_config.pb.h(1309): error C2238: unexpected token(s) preceding ';'

Missing some compiler flags ?

Thanks

@danditomaso
Copy link

danditomaso commented Jan 19, 2025

Can I ask how you went about compiling the protobufs for C#? Or was there a nuget package you used?

@hexabyte23
Copy link
Author

Its C++ files generated by regular protoc tool, no C# here.

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