-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
mingw compilation fails on Ubuntu 18.04 (Bionic) #5460
Comments
Xenial has a newer version of mingw-w64 which is more standards compliant. Per the man page of
Here's time.h in trusty (v3.1.0): https://github.com/mirror/mingw-w64/blob/v3.1.0/mingw-w64-headers/crt/time.h Here's time.h in xenial (v5.0.1): https://github.com/mirror/mingw-w64/blob/v5.0.1/mingw-w64-headers/crt/time.h So I think you need to add |
@tamird thanks for the suggestion, unfortunately it doesn't seem to help. |
I was able to reproduce. Here's what fixed it: diff --git a/CMakeLists.txt b/CMakeLists.txt
index 006f679..eda1281 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -183,6 +183,7 @@ else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-compare -Wshadow -Wno-unused-parameter -Wno-unused-variable -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -Wno-strict-aliasing")
if(MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format")
+ add_definitions(-D_POSIX_C_SOURCE=1)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") My guess is that #define in |
@tamird That fixes the issue. Awesome! - thank you very much :-) |
Compiling RocksDB on Ubuntu 18.04 (Bionic) with mingw fails.
The steps I took:
The error:
@tamird Any ideas about how to fix this? I tried modifying
port/sys_time.h
to be like:But that just leads to problems elsewhere in the compilation related to
localtime_r
.This is the last issue I need to solve to enable us to update Travis CI to Xenial (#4789)
The text was updated successfully, but these errors were encountered: