Skip to content
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

Small compilation problems in Mingw-w64 #26

Open
thomask77 opened this issue Sep 15, 2020 · 0 comments
Open

Small compilation problems in Mingw-w64 #26

thomask77 opened this issue Sep 15, 2020 · 0 comments

Comments

@thomask77
Copy link
Contributor

thomask77 commented Sep 15, 2020

Hi!

I'm using MSYS2 / mingw-w64 and have 3 minor issues when building with either GCC or clang.

Steps to reproduce:

  • Install MSYS2
pacman -Syu mingw-w64-x86_64-clang
pacman -Syu mingw-w64-x86_64-cmake
pacman -Syu mingw-w64-x86_64-ninja

# clang version 10.0.1 (https://github.com/Alexpux/MINGW-packages.git 94b687508346d10cec7e8c769785f73da18b4e54)
# Target: x86_64-w64-windows-gnu
# Thread model: posix
# InstalledDir: C:\msys64\mingw64\bin

mkdir build && cd build
CC=clang CXX=clang++ cmake .. -G"Ninja"
ninja

1st problem:

_deps/mahi-gui-src/src/Mahi/Gui/nanovg_custom.cpp:14:12: error: no member named 'memcpy' in namespace 'std'; did you mean 'wmemcpy'?
using std::memcpy;
      ~~~~~^~~~~~
           wmemcpy
C:\msys64\mingw64\include\c++\10.2.0\cwchar:201:11: note: 'wmemcpy' declared here
  using ::wmemcpy;
          ^
1 error generated.

2nd problem:

_deps/mahi-gui-src/src/Mahi/Gui/Application.cpp:24:12: error: no member named 'memcpy' in namespace 'std'; did you mean 'wmemcpy'?
using std::memcpy;
      ~~~~~^~~~~~
           wmemcpy
C:\msys64\mingw64\include\c++\10.2.0\cwchar:201:11: note: 'wmemcpy' declared here
  using ::wmemcpy;
          ^
1 error generated.

-> Both are easily fixed by adding #include <cstring>

3rd problem:
_deps/mahi-util-src/src/Mahi/Util/System.cpp:344:15: error: no member named 'GetFileVersionInfoSizeExW' in the global namespace
            ::GetFileVersionInfoSizeExW(FILE_VER_GET_NEUTRAL, system, &dummy);
            ~~^
_deps/mahi-util-src/src/Mahi/Util/System.cpp:344:41: error: use of undeclared identifier 'FILE_VER_GET_NEUTRAL'
            ::GetFileVersionInfoSizeExW(FILE_VER_GET_NEUTRAL, system, &dummy);
                                        ^
_deps/mahi-util-src/src/Mahi/Util/System.cpp:346:11: error: no member named 'GetFileVersionInfoExW' in the global namespace
        ::GetFileVersionInfoExW(FILE_VER_GET_NEUTRAL, system, dummy, (DWORD)buffer.size(), &buffer[0]);
        ~~^
_deps/mahi-util-src/src/Mahi/Util/System.cpp:346:33: error: use of undeclared identifier 'FILE_VER_GET_NEUTRAL'
        ::GetFileVersionInfoExW(FILE_VER_GET_NEUTRAL, system, dummy, (DWORD)buffer.size(), &buffer[0]);
                                ^
4 errors generated.

I fixed this by using the non-ex variants GetFileVersionInfoSizeW and GetFileVersionInfoW and omitting the FILE_VER_GET_NEUTRAL flag.

The demo application runs fine after these fixes (with both GCC, clang and make or Ninja as a build Tool).

Should I send a pull request, or could you implement and test those fixes yourself?

I'm unsure about the 3rd point. What's the reason for FILE_VER_GET_NEUTRAL?

@thomask77 thomask77 changed the title Small compilation problems in MSYS2 Small compilation problems in Mingw-w64 Sep 16, 2020
thomask77 pushed a commit to thomask77/mahi-util that referenced this issue Sep 16, 2020
thomask77 pushed a commit to thomask77/mahi-gui that referenced this issue Sep 16, 2020
thomask77 pushed a commit to thomask77/mahi-util that referenced this issue Sep 16, 2020
thomask77 pushed a commit to thomask77/mahi-gui that referenced this issue Sep 16, 2020
thomask77 pushed a commit to thomask77/mahi-gui that referenced this issue Sep 16, 2020
thomask77 pushed a commit to thomask77/mahi-gui that referenced this issue Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant