8000 Small compilation problems in Mingw-w64 · Issue #26 · mahilab/mahi-gui · GitHub 10000
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Small compilation problems in Mingw-w64 #26
Open
@thomask77

Description

@thomask77

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0