Closed Illia-Vidanov closed 3 months ago
Looks like an issue in msys2 ucrt64 headers. dbghelp.h either does not see or purposefully does not include standard typedefs.
Does the issue go away if you add #include <windows.h>
at the top of src/demangle.cc
just before dbghelp.h is included?
Thanks for reply! Yes it solves the issue with dbghelp.h, but I guess it's not the only issue with msys2 headers. They also doesn't contain declarations for localtime_r and gmtime_r, as well as for strerror_r (which is a gnu extension?) for logging.cc file I also tried compiling it using msys2's mingw64 compiler and by freshly installed default mingw64 compiler from github but still same errors about localtime_r gmtime_r and strerror_r:
C:/path/glog/src/logging.cc:1128:7: error: 'gmtime_r' was not declared in this scope; did you mean 'gmtime_s'?
1128 | gmtime_r(&t, &tm_time);
| ^~~~~~~~
| gmtime_s
C:/path/glog/src/logging.cc:1130:7: error: 'localtime_r' was not declared in this scope; did you mean 'localtime_s'?
1130 | localtime_r(&t, &tm_time);
| ^~~~~~~~~~~
| localtime_s
C:/path/glog/src/logging.cc: In function 'int google::posix_strerror_r(int, char*, size_t)':
C:/path/glog/src/logging.cc:2486:38: error: 'strerror_r' was not declared in this scope; did you mean 'strerror_s'?
2486 | char* rc = reinterpret_cast<char*>(strerror_r(err, buf, len));
| ^~~~~~~~~~
| strerror_s
...
Our mingw64 and mingw32 CI builds compile without issues. I guess you are using msys2 POSIX compatible GCC (i.e., without setting MSYSTEM
). That's not supported at the moment.
Thank you very much! finally I know what is wrong with my programming envoriment)
So I was folowing the exact steps described in manual
I also tried building gflags separatelly and adding gflags_DIR like this:
>cmake -S . -B build -G "Unix Makefiles" -Dgflags_DIR="/c/path/gflags/build"
but the only differance was that it didn't print the warningAnd here is some more envoriment info:
Also no google packages are installed by msys2, I know I can install and use them using msys2's package manager, but I wounder why can't I do it using cmake. The same problem arises when library is included using 'sub_dirctory' inside of my project's CMakeLists.txt