heremaps/here-data-sdk-cpp

Build with MinGW-w64

lezipg opened this issue · 11 comments

I'm trying to build with mingw w64 and got following error:

olp-cpp-sdk-core\src\http\winhttp\NetworkWinHttp.cpp:473:11: error: 'WINHTTP_DECOMPRESSION_FLAG_ALL' was not declared in this scope flags = WINHTTP_DECOMPRESSION_FLAG_ALL;

Would someone please add mingw-w64 support?

@lezipg Thank you for opening the first-ever issue for this SDK. Sadly there is no award attached to this honor.

As for your mingw-w64 issue, I must say it is a pretty uncommon supported environment, especially with NetworkWinHttp which requires Windows native libs.
Also, I would not assume to use NetworkWinHttp under Mingw-w64 but rather the curl based overload for UNIX systems. I wonder why the WIN32 CMake variable is set at all, it should be MINGW which should put you into the NetworkCurl which should build properly, assuming you provide a valid libcurl.so in your library path.

Is it a long-term solution on your side using Mingw-w64 or only for development purposes?

@andescu Thanks for the quick respond. I have tried to force cmake to use curl and it didn't work. Apparently these codes are focused on gcc, like the signal.h is different as from mingw-w64.

Yes, we're using mingw-w64 for long term. Actually we're changing from DataStore API to OLP and
wondering if we need to use this sdk.

Even if we add Mingw-w64 support it will definitely not be for WinHttp. I don't think that this is even possible as it highly depends on Windows libraries and includes.

Can you tell me how do you want to include our library? Is it with add_subdirectory from a root CMakeLists.txt file or are you trying to build and install upfront?

This SDK offers you an easy framework to communicate with the new OLP Data API so it is recommended to use it. You will benefit from many optimizations like cache, indexed queries, and prefetching that you normally would have to figure out and implement yourself.

Right, my wish would be mingw-w64 support with curl for Windows, if possible. For the DataStore API i'm using the libcurl for Windows.
I'm trying to build the sdk then link the library from install. It's more easier or perhaps the only possible way as i need to link these libraries in our project using Makefile.

@lezipg We are currently trying internally to see what is the effort to force cmake triggering the curl based network layer to build. But for the long run, I am not sure if we can provide a stable mingw support as we have clear dependencies (leveldb, boost, RapidJson) which do not come with mingw support themselves. So I am not sure if this will eventually work.

Anyway, we will provide feedback asap with the internal analysis.

@andescu Great! Thanks for the effort!

@lezipg Sorry for the delay, we needed to move this ticket to v1.5 due to some internal issues that were more burning. We anyway took it to the current sprint and will have an answer in the next two weeks if we are going to support this or a workaround on how to achieve. Does this sound ok to you?

@lezipg Can you please check PR #735 on your side to see if this would solve your problem. Once you give us positive feedback, we will decide if we support mingw in the long term or just on a hotfix basis.

@andescu Thanks for this information! Due to COVID-19 i may postpone my work. However, i'll check it as soon as possible.

@andescu It works with mingw-w64 on my side. Thank you!

Good to hear.