-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Hi. I'm trying to compile and link to libdave using the Mingw GNU toolchain (gcc, g++) using the generic persisted keypair implementation. I'm aware there is a Windows-native one, but I just want to make sure that the generic implementation works as well.
There are two issues in persisted_key_pair_generic.cpp that prevent successful compilation currently:
-
'class std::basic_ostream<char>' has no member named 'str'- Line 97 has the following code, which apparently compiles fine with MSVC, but won't with gcc. This is likely due to different standard library implementations. This is apparently a common issue and the recommended fix seems to be either to
static_castbefore calling .str() on it, or to expand it into multiple lines with typed variables.
libdave/cpp/src/dave/mls/detail/persisted_key_pair_generic.cpp
Lines 96 to 98 in 6e5ffbc
curstr = (std::stringstream() << ifs.rdbuf()).str(); if (!ifs) {
- Line 97 has the following code, which apparently compiles fine with MSVC, but won't with gcc. This is likely due to different standard library implementations. This is apparently a common issue and the recommended fix seems to be either to
-
_S_IREADand_S_IWRITEnot declared in scope- Line 120 has the following code, which fails to compile due to a missing include for
<sys/stat.h>under _WIN32. I haven't tested compiling this with MSVC, but this seems like a generic issue that would affect not just the GNU toolchain.
libdave/cpp/src/dave/mls/detail/persisted_key_pair_generic.cpp
Lines 119 to 121 in 6e5ffbc
#ifdef _WIN32 int fd = _wopen(tmpfile.c_str(), _O_WRONLY | _O_CREAT | _O_TRUNC, _S_IREAD | _S_IWRITE); #else
- Line 120 has the following code, which fails to compile due to a missing include for
Could this be reproduced and investigated? Thanks!