Open acidtonic opened 3 years ago
I'd also be open to a workaround that involves a lighter client-only oatpp-postgres library which would let me get the datatypes for postgresql in the DTO's imported such that API Client code can be generated.
On windows I really only need oatpp-postgresql for building the API Client calls and will not be using the server/dbclient code anyways. I'm trying to distribute a windows client that speaks to the oatpp-postgresql server on linux. Is there a lighter solution?
I spent more time toying with stdc++ and seh vs sjlj exception types along with various compiler flags and cannot make progress. Help!
Hello @acidtonic ,
On windows I really only need oatpp-postgresql for building the API Client calls and will not be using the server/dbclient code anyways. I'm trying to distribute a windows client that speaks to the oatpp-postgresql server on linux. Is there a lighter solution?
Can you please give more details?
As I understand, if you have a working oatpp-postgresql server on Linux, then all you need - is to expose REST API.
Then on Windows, you can consume that REST API via oatpp ApiClient.
Thus no oatpp-postgresql
is needed on Windows (in your case)
That is indeed what I am trying to accomplish but the DTO headers point to postgresql types so the auto generated API client calls for the windows side cannot be compiled.
Am I missing something easier?
Linux -> Running oatpp server. DTO's defined with oatpp-postgresql types.
Windows -> Client only, will consume rest endpoints from server, autogenerated API Client from DTOs (fail to build since oatpp-postgres is needed to fulfill the header DTO types).
Yes, So at the moment, I can think of two available workarounds:
Can't build oatpp-postgres on windows mingw-w64 toolchain. I get lots of linker errors to the tune of 187mb error log. Here are a few to capture the spirit of the errors.
Steps to reproduce (I can be more detailed if needed) -> Windows -> msys2 -> pacman -S build-essential mingw-w64-x86_64-toolchain cmake git -> checkout oatpp -> build/install it using -G"MinGW Makefiles" or -G"MSYS Makefiles" -> build oatpp-postgresql and when the tests are built the following is produced...
I tried using postgresql from the offical pacman repository for mingw-w64 and thought maybe building postgresql from source with the same w64-toolchain instead would work but neither option changed anything. I also toyed with changing CXX EXTENSIONS to on/off between the projects and update the std flag for C++11 to c++14/c++17 and none of them built. I also tried adding -stdc++ to the build flags, and forcing the g++ compiler for linking.... Also tried using objdump/file/nm to inspect the .a files only to find they all were x86-64 as intended and nothing was 32-bit. All had the same seh/sjlj settings and endianness. I'm stuck :(