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
protobuf 3.18.0 fails to build on Windows with MinGW-w64 GCC with the following errors:
R:/winlibs64-10.3.0/protobuf-3.18.0/src/google/protobuf/io/zero_copy_stream_impl.cc:108:28: error: 'F_GETFL' was not declared in this scope
108 | int flags = fcntl(file_, F_GETFL);
| ^~~~~~~
R:/winlibs64-10.3.0/protobuf-3.18.0/src/google/protobuf/io/zero_copy_stream_impl.cc:108:15: error: 'fcntl' was not declared in this scope
108 | int flags = fcntl(file_, F_GETFL);
| ^~~~~
R:/winlibs64-10.3.0/protobuf-3.18.0/src/google/protobuf/io/zero_copy_stream_impl.cc:109:13: error: 'O_NONBLOCK' was not declared in this scope
109 | flags &= ~O_NONBLOCK;
| ^~~~~~~~~~
R:/winlibs64-10.3.0/protobuf-3.18.0/src/google/protobuf/io/zero_copy_stream_impl.cc:110:16: error: 'F_SETFL' was not declared in this scope
110 | fcntl(file_, F_SETFL, flags);
| ^~~~~~~
The solution is to replace _MSC_VER with _WIN32 in src/google/protobuf/io/zero_copy_stream_impl.cc.
Apparently a false assumption was made _MSC_VER is always set on the Windows platform, but that is only the case when building with MSVC. On MSVC and MinGW gcc and clang _WIN32 is always defined however.
The text was updated successfully, but these errors were encountered:
protobuf 3.18.0 fails to build on Windows with MinGW-w64 GCC with the following errors:
The solution is to replace
_MSC_VER
with_WIN32
insrc/google/protobuf/io/zero_copy_stream_impl.cc
.Apparently a false assumption was made
_MSC_VER
is always set on the Windows platform, but that is only the case when building with MSVC. On MSVC and MinGW gcc and clang_WIN32
is always defined however.The text was updated successfully, but these errors were encountered: