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

Can't build with cmake? #17

Open
Badhansen opened this issue Feb 25, 2021 · 5 comments
Open

Can't build with cmake? #17

Badhansen opened this issue Feb 25, 2021 · 5 comments

Comments

@Badhansen
Copy link

Badhansen commented Feb 25, 2021

Everything works fine until now I am facing this error.

D:>cd ../skui-build
D:\skui-build>cmake ../skui -G Ninja
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/MinGW/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/MinGW/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: opengl32
-- Configuring done
-- Generating done
-- Build files have been written to: D:/skui-build

D:\skui-build>cmake --build .
[42/1007] Building CXX object 3rdparty/skia/CMakeFiles/skia.dir/src/codec/SkBmpRLECodec.cpp.obj
FAILED: 3rdparty/skia/CMakeFiles/skia.dir/src/codec/SkBmpRLECodec.cpp.obj
C:\MinGW\bin\c++.exe -DNOMINMAX -DSKIA_IMPLEMENTATION=1 -DSK_HAS_PNG_LIBRARY -DWIN32_LEAN_AND_MEAN -ID:/skui/3rdparty/libpng -ID:/skui/3rdparty/zlib -ID:/skui/3rdparty/libexpat -ID:/skui/3rdparty/giflib -ID:/skui/3rdparty/libjpeg-turbo -isystem D:/skui/3rdparty/skia/include/third_party/skcms -isystem D:/skui/3rdparty/skia/. -pedantic-errors -Wextra -Wconversion -Winit-self -Wmissing-include-dirs -Wstrict-aliasing -Werror -ffunction-sections -fdata-sections -Wno-conversion -Wno-pedantic -Wno-missing-field-initializers -Wno-sign-compare -Wno-unused-parameter -Wno-deprecated-declarations -Wno-narrowing -Wimplicit-fallthrough=0 -Wformat=0 -Wno-format-extra-args -Wno-int-in-bool-context -Wno-strict-aliasing -Wno-unused -Wno-ignored-attributes -Wno-unknown-pragmas -Wno-sizeof-pointer-memaccess -Wno-class-memaccess -Wno-stringop-overflow -Wno-array-bounds -Wno-restrict -Wno-stringop-truncation -Wno-cast-function-type -Wno-maybe-uninitialized -std=c++17 -MD -MT 3rdparty/skia/CMakeFiles/skia.dir/src/codec/SkBmpRLECodec.cpp.obj -MF 3rdparty\skia\CMakeFiles\skia.dir\src\codec\SkBmpRLECodec.cpp.obj.d -o 3rdparty/skia/CMakeFiles/skia.dir/src/codec/SkBmpRLECodec.cpp.obj -c D:/skui/3rdparty/skia/src/codec/SkBmpRLECodec.cpp
In file included from d:\skui\3rdparty\skia\include\core\skrefcnt.h:11,
from d:\skui\3rdparty\skia\include\core\skdata.h:13,
from d:\skui\3rdparty\skia\include\core\skstream.h:11,
from D:/skui/3rdparty/skia/src/codec/SkBmpRLECodec.cpp:8:
d:\skui\3rdparty\skia\include\core\sktypes.h:340:14: fatal error: crtdbg.h: No such file or directory
#include <crtdbg.h>
^~~~~~~~~~
compilation terminated.
[44/1007] Building CXX object 3rdparty/skia/CMakeFiles/skia.dir/src/codec/SkBmpStandardCodec.cpp.obj
FAILED: 3rdparty/skia/CMakeFiles/skia.dir/src/codec/SkBmpStandardCodec.cpp.obj
C:\MinGW\bin\c++.exe -DNOMINMAX -DSKIA_IMPLEMENTATION=1 -DSK_HAS_PNG_LIBRARY -DWIN32_LEAN_AND_MEAN -ID:/skui/3rdparty/libpng -ID:/skui/3rdparty/zlib -ID:/skui/3rdparty/libexpat -ID:/skui/3rdparty/giflib -ID:/skui/3rdparty/libjpeg-turbo -isystem D:/skui/3rdparty/skia/include/third_party/skcms -isystem D:/skui/3rdparty/skia/. -pedantic-errors -Wextra -Wconversion -Winit-self -Wmissing-include-dirs -Wstrict-aliasing -Werror -ffunction-sections -fdata-sections -Wno-conversion -Wno-pedantic -Wno-missing-field-initializers -Wno-sign-compare -Wno-unused-parameter -Wno-deprecated-declarations -Wno-narrowing -Wimplicit-fallthrough=0 -Wformat=0 -Wno-format-extra-args -Wno-int-in-bool-context -Wno-strict-aliasing -Wno-unused -Wno-ignored-attributes -Wno-unknown-pragmas -Wno-sizeof-pointer-memaccess -Wno-class-memaccess -Wno-stringop-overflow -Wno-array-bounds -Wno-restrict -Wno-stringop-truncation -Wno-cast-function-type -Wno-maybe-uninitialized -std=c++17 -MD -MT 3rdparty/skia/CMakeFiles/skia.dir/src/codec/SkBmpStandardCodec.cpp.obj -MF 3rdparty\skia\CMakeFiles\skia.dir\src\codec\SkBmpStandardCodec.cpp.obj.d -o 3rdparty/skia/CMakeFiles/skia.dir/src/codec/SkBmpStandardCodec.cpp.obj -c D:/skui/3rdparty/skia/src/codec/SkBmpStandardCodec.cpp
In file included from d:\skui\3rdparty\skia\include\core\skrefcnt.h:11,
from d:\skui\3rdparty\skia\include\core\skdata.h:13,
from d:\skui\3rdparty\skia\include\core\skstream.h:11,
from D:/skui/3rdparty/skia/src/codec/SkBmpStandardCodec.cpp:8:
d:\skui\3rdparty\skia\include\core\sktypes.h:340:14: fatal error: crtdbg.h: No such file or directory
#include <crtdbg.h>
^~~~~~~~~~
compilation terminated.
[45/1007] Building CXX object 3rdparty/skia/CMakeFiles/skia.dir/src/codec/SkBmpBaseCodec.cpp.obj
FAILED: 3rdparty/skia/CMakeFiles/skia.dir/src/codec/SkBmpBaseCodec.cpp.obj
C:\MinGW\bin\c++.exe -DNOMINMAX -DSKIA_IMPLEMENTATION=1 -DSK_HAS_PNG_LIBRARY -DWIN32_LEAN_AND_MEAN -ID:/skui/3rdparty/libpng -ID:/skui/3rdparty/zlib -ID:/skui/3rdparty/libexpat -ID:/skui/3rdparty/giflib -ID:/skui/3rdparty/libjpeg-turbo -isystem D:/skui/3rdparty/skia/include/third_party/skcms -isystem D:/skui/3rdparty/skia/. -pedantic-errors -Wextra -Wconversion -Winit-self -Wmissing-include-dirs -Wstrict-aliasing -Werror -ffunction-sections -fdata-sections -Wno-conversion -Wno-pedantic -Wno-missing-field-initializers -Wno-sign-compare -Wno-unused-parameter -Wno-deprecated-declarations -Wno-narrowing -Wimplicit-fallthrough=0 -Wformat=0 -Wno-format-extra-args -Wno-int-in-bool-context -Wno-strict-aliasing -Wno-unused -Wno-ignored-attributes -Wno-unknown-pragmas -Wno-sizeof-pointer-memaccess -Wno-class-memaccess -Wno-stringop-overflow -Wno-array-bounds -Wno-restrict -Wno-stringop-truncation -Wno-cast-function-type -Wno-maybe-uninitialized -std=c++17 -MD -MT 3rdparty/skia/CMakeFiles/skia.dir/src/codec/SkBmpBaseCodec.cpp.obj -MF 3rdparty\skia\CMakeFiles\skia.dir\src\codec\SkBmpBaseCodec.cpp.obj.d -o 3rdparty/skia/CMakeFiles/skia.dir/src/codec/SkBmpBaseCodec.cpp.obj -c D:/skui/3rdparty/skia/src/codec/SkBmpBaseCodec.cpp
In file included from d:\skui\3rdparty\skia\include\private\skmalloc.h:14,
from D:/skui/3rdparty/skia/src/codec/SkBmpBaseCodec.cpp:7:
d:\skui\3rdparty\skia\include\core\sktypes.h:340:14: fatal error: crtdbg.h: No such file or directory
#include <crtdbg.h>
^~~~~~~~~~
compilation terminated.
[46/1007] Building CXX object 3rdparty/skia/CMakeFiles/skia.dir/src/codec/SkBmpMaskCodec.cpp.obj
FAILED: 3rdparty/skia/CMakeFiles/skia.dir/src/codec/SkBmpMaskCodec.cpp.obj
C:\MinGW\bin\c++.exe -DNOMINMAX -DSKIA_IMPLEMENTATION=1 -DSK_HAS_PNG_LIBRARY -DWIN32_LEAN_AND_MEAN -ID:/skui/3rdparty/libpng -ID:/skui/3rdparty/zlib -ID:/skui/3rdparty/libexpat -ID:/skui/3rdparty/giflib -ID:/skui/3rdparty/libjpeg-turbo -isystem D:/skui/3rdparty/skia/include/third_party/skcms -isystem D:/skui/3rdparty/skia/. -pedantic-errors -Wextra -Wconversion -Winit-self -Wmissing-include-dirs -Wstrict-aliasing -Werror -ffunction-sections -fdata-sections -Wno-conversion -Wno-pedantic -Wno-missing-field-initializers -Wno-sign-compare -Wno-unused-parameter -Wno-deprecated-declarations -Wno-narrowing -Wimplicit-fallthrough=0 -Wformat=0 -Wno-format-extra-args -Wno-int-in-bool-context -Wno-strict-aliasing -Wno-unused -Wno-ignored-attributes -Wno-unknown-pragmas -Wno-sizeof-pointer-memaccess -Wno-class-memaccess -Wno-stringop-overflow -Wno-array-bounds -Wno-restrict -Wno-stringop-truncation -Wno-cast-function-type -Wno-maybe-uninitialized -std=c++17 -MD -MT 3rdparty/skia/CMakeFiles/skia.dir/src/codec/SkBmpMaskCodec.cpp.obj -MF 3rdparty\skia\CMakeFiles\skia.dir\src\codec\SkBmpMaskCodec.cpp.obj.d -o 3rdparty/skia/CMakeFiles/skia.dir/src/codec/SkBmpMaskCodec.cpp.obj -c D:/skui/3rdparty/skia/src/codec/SkBmpMaskCodec.cpp
In file included from d:\skui\3rdparty\skia\include\core\skrefcnt.h:11,
from d:\skui\3rdparty\skia\include\core\skcolorspace.h:11,
from d:\skui\3rdparty\skia\include\core\skimageinfo.h:11,
from d:\skui\3rdparty\skia\include\core\skcolor.h:11,
from d:\skui\3rdparty\skia\include\private\skcolordata.h:11,
from D:/skui/3rdparty/skia/src/codec/SkBmpMaskCodec.cpp:8:
d:\skui\3rdparty\skia\include\core\sktypes.h:340:14: fatal error: crtdbg.h: No such file or directory
#include <crtdbg.h>
^~~~~~~~~~
compilation terminated.
[47/1007] Building C object 3rdparty/CMakeFiles/jpeg-turbo.dir/libjpeg-turbo/jidctint.c.obj
ninja: build stopped: subcommand failed.

@rubenvb
Copy link
Contributor

rubenvb commented Feb 25, 2021

It seems your MinGW install is missing headers required by Skia. I would guess you're using the MinGW.org variant, which unfortunately is missing quite a lot of the more modern Windows API. Please try with a MinGW-w64 toolchain, e.g. the one you can install through MSYS2.

@Badhansen
Copy link
Author

Hello! Ruben, I have installed the MinGW-w64 toolchain using this Msys2 but the issue exists.

@rubenvb
Copy link
Contributor

rubenvb commented Feb 26, 2021

I cannot reproduce your build issue with my local MSYS2 install.

I don't think you're using the MSYS2 MinGW-w64 compilers. The output you show points to C:\MinGW\bin\c++.exe, not where the MSYS2 MinGW-w64 compiler would be, by default that would be C:\msys2\mingw64\bin\g++.exe.

Please ensure you're pointing CMake to the correct compiler when generating (automatic if you're running cmake from the MSYS2 MinGW-w64 shell), and that your MSYS2 is than up to date. The current GCC version through MSYS2 is 10.2.0, not 8.2.0.

@Badhansen
Copy link
Author

I reinstall and fixed the environment path for mingw64 but now I get this error.
Is everything okay for CMake build?

D:\skui-build>cmake ../skui -G Ninja
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: opengl32
-- Configuring done
-- Generating done
-- Build files have been written to: D:/skui-build

D:\skui-build>cmake --build .
[456/1007] Building CXX object 3rdparty/skia/CMakeFiles/skia.dir/src/ports/SkScalerContext_win_dw.cpp.obj
FAILED: 3rdparty/skia/CMakeFiles/skia.dir/src/ports/SkScalerContext_win_dw.cpp.obj
C:\msys64\mingw64\bin\c++.exe -DNOMINMAX -DSKIA_IMPLEMENTATION=1 -DSK_HAS_PNG_LIBRARY -DWIN32_LEAN_AND_MEAN -ID:/skui/3rdparty/libpng -ID:/skui/3rdparty/zlib -ID:/skui/3rdparty/libexpat -ID:/skui/3rdparty/giflib -ID:/skui/3rdparty/libjpeg-turbo -isystem D:/skui/3rdparty/skia/include/third_party/skcms -isystem D:/skui/3rdparty/skia/. -pedantic-errors -Wextra -Wconversion -Winit-self -Wmissing-include-dirs -Wstrict-aliasing -Werror -ffunction-sections -fdata-sections -Wno-conversion -Wno-pedantic -Wno-missing-field-initializers -Wno-sign-compare -Wno-unused-parameter -Wno-deprecated-declarations -Wno-narrowing -Wimplicit-fallthrough=0 -Wformat=0 -Wno-format-extra-args -Wno-int-in-bool-context -Wno-strict-aliasing -Wno-unused -Wno-ignored-attributes -Wno-unknown-pragmas -Wno-sizeof-pointer-memaccess -Wno-class-memaccess -Wno-stringop-overflow -Wno-array-bounds -Wno-restrict -Wno-stringop-truncation -Wno-cast-function-type -Wno-redundant-move -Wno-deprecated-copy -Wno-maybe-uninitialized -std=c++17 -MD -MT 3rdparty/skia/CMakeFiles/skia.dir/src/ports/SkScalerContext_win_dw.cpp.obj -MF 3rdparty\skia\CMakeFiles\skia.dir\src\ports\SkScalerContext_win_dw.cpp.obj.d -o 3rdparty/skia/CMakeFiles/skia.dir/src/ports/SkScalerContext_win_dw.cpp.obj -c D:/skui/3rdparty/skia/src/ports/SkScalerContext_win_dw.cpp
In file included from D:/skui/3rdparty/skia/src/ports/SkTypeface_win_dw.h:16,
from D:/skui/3rdparty/skia/src/ports/SkScalerContext_win_dw.h:14,
from D:/skui/3rdparty/skia/src/ports/SkScalerContext_win_dw.cpp:27:
D:/skui/3rdparty/skia/src/ports/SkScalerContext_win_dw.cpp: In member function 'bool SkScalerContext_DW::isPngGlyph(const SkGlyph&)':
D:/skui/3rdparty/skia/src/ports/SkScalerContext_win_dw.cpp:523:79: error: no matching function for call to 'IDWriteFontFace4::GetGlyphImageFormats(SkGlyphID, int, unsigned int, DWRITE_GLYPH_IMAGE_FORMATS*)'
523 | HRBM(fontFace4->GetGlyphImageFormats(glyph.getGlyphID(), 0, UINT32_MAX, &f),
| ^
In file included from D:/skui/3rdparty/skia/src/ports/SkTypeface_win_dw.h:22,
from D:/skui/3rdparty/skia/src/ports/SkScalerContext_win_dw.h:14,
from D:/skui/3rdparty/skia/src/ports/SkScalerContext_win_dw.cpp:27:
C:/msys64/mingw64/x86_64-w64-mingw32/include/dwrite_3.h:8182:58: note: candidate: 'virtual DWRITE_GLYPH_IMAGE_FORMATS IDWriteFontFace4::GetGlyphImageFormats()'
8182 | virtual DWRITE_GLYPH_IMAGE_FORMATS STDMETHODCALLTYPE GetGlyphImageFormats(
| ^~~~~~~~~~~~~~~~~~~~
C:/msys64/mingw64/x86_64-w64-mingw32/include/dwrite_3.h:8182:58: note: candidate expects 0 arguments, 4 provided
[461/1007] Building CXX object 3rdparty/skia/CMakeFiles/skia.dir/src/utils/win/SkDWrite.cpp.obj
ninja: build stopped: subcommand failed.

D:\skui-build>

@rubenvb
Copy link
Contributor

rubenvb commented Feb 26, 2021

Yes I get that too. It seems the Skia version that is currently used uses functionality not available in the current MinGW-w64 headers. I'll see if I can correct that. In the meantime, you'll need to use a different platform/toolchain. The community edition of VS2019 will also work, or anything on Linux.

Skia comes from Chrome (and is used in e.g. Firefox and Openoffice too), and they tend to use various "fancy features" not always immediately in MinGW-w64. But I can try to correct this omission, as I did a previous one like this before.

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

2 participants