[SOLVED] Trouble compiling Aseprite on Windows

I’m not sure what I’m doing wrong but I keep getting a fatal error when “Linking CXX executable bin\aseprite.exe”. It says it failed with the following output:
LINK : warning LNK4044: unrecognized option ‘/LINK’; ignored
LINK : warning LNK4075: ignoring ‘/INCREMENTAL’ due to ‘/LTCG’ specification
Then there are a bunch of LNK2001 errors about “unresolved external symbol” and the fatal error is LNK1120 which I believe is because of the LNK2001 errors. Everything works fine until I type in “ninja aseprite”. It loads to [1502/1502] Linking CXX executable bin\aseprite.exe, then says it failed.

These are some sections that look the most important:

[1224/1224] Linking CXX executable bin\aseprite.exe
FAILED: bin/aseprite.exe
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=src\CMakeFiles\aseprite.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x86\mt.exe --manifests ..\src\main\settings.manifest -- C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1428~1.299\bin\Hostx86\x86\link.exe /nologo src\CMakeFiles\aseprite.dir\main\main.cpp.obj src\CMakeFiles\aseprite.dir\main\resources_win32.rc.res  /out:bin\aseprite.exe /implib:lib\aseprite.lib /pdb:bin\aseprite.pdb /version:0.0 /machine:X86 /LTCG /debug /INCREMENTAL /subsystem:windows -LINK wsetargv.obj -ENTRY:"wWinMainCRTStartup"  lib\app-lib.lib  lib\cfg-lib.lib  lib\clip.lib  lib\dio-lib.lib  lib\filters-lib.lib  lib\flic-lib.lib  lib\tga-lib.lib  lib\render-lib.lib  lib\doc-lib.lib  lib\fixmath-lib.lib  lib\ui-lib.lib  lib\laf-os.lib  lib\laf-gfx.lib  lib\laf-ft.lib  lib\laf-base.lib  lib\modpbase64.lib  version.lib  C:\deps\skia\out\Release-x64\skia.lib  "C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x86\OpenGL32.Lib"  kernel32.lib  user32.lib  gdi32.lib  comdlg32.lib  winmm.lib  psapi.lib  wininet.lib  comctl32.lib  dbghelp.lib  C:\deps\skia\out\Release-x64\skshaper.lib  lib\obs.lib  lib\ver-lib.lib  lib\undo.lib  lib\cmark_static.lib  lib\tinyxml.lib  lib\jpeg.lib  lib\giflib.lib  lib\webpdemux.lib  lib\webpmux.lib  lib\webp.lib  shlwapi.lib  ole32.lib  windowscodecs.lib  lib\freetype.lib  lib\harfbuzz.lib  lib\freetype.lib  lib\harfbuzz.lib  lib\libpng16_static.lib  lib\json11.lib  lib\archive_static.lib  lib\zlibstatic.lib  lib\fmt.lib  lib\tinyexpr.lib  lib\lauxlib.lib  lib\lua.lib  lib\lualib.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK Pass 1: command "C:\PROGRA~2\MICROS~3\2019\COMMUN~1\VC\Tools\MSVC\1428~1.299\bin\Hostx86\x86\link.exe /nologo src\CMakeFiles\aseprite.dir\main\main.cpp.obj src\CMakeFiles\aseprite.dir\main\resources_win32.rc.res /out:bin\aseprite.exe /implib:lib\aseprite.lib /pdb:bin\aseprite.pdb /version:0.0 /machine:X86 /LTCG /debug /INCREMENTAL /subsystem:windows -LINK wsetargv.obj -ENTRY:wWinMainCRTStartup lib\app-lib.lib lib\cfg-lib.lib lib\clip.lib lib\dio-lib.lib lib\filters-lib.lib lib\flic-lib.lib lib\tga-lib.lib lib\render-lib.lib lib\doc-lib.lib lib\fixmath-lib.lib lib\ui-lib.lib lib\laf-os.lib lib\laf-gfx.lib lib\laf-ft.lib lib\laf-base.lib lib\modpbase64.lib version.lib C:\deps\skia\out\Release-x64\skia.lib C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x86\OpenGL32.Lib kernel32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib psapi.lib wininet.lib comctl32.lib dbghelp.lib C:\deps\skia\out\Release-x64\skshaper.lib lib\obs.lib lib\ver-lib.lib lib\undo.lib lib\cmark_static.lib lib\tinyxml.lib lib\jpeg.lib lib\giflib.lib lib\webpdemux.lib lib\webpmux.lib lib\webp.lib shlwapi.lib ole32.lib windowscodecs.lib lib\freetype.lib lib\harfbuzz.lib lib\freetype.lib lib\harfbuzz.lib lib\libpng16_static.lib lib\json11.lib lib\archive_static.lib lib\zlibstatic.lib lib\fmt.lib lib\tinyexpr.lib lib\lauxlib.lib lib\lua.lib lib\lualib.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:src\CMakeFiles\aseprite.dir/intermediate.manifest src\CMakeFiles\aseprite.dir/manifest.res" failed (exit code 1120) with the following output:
LINK : warning LNK4044: unrecognized option '/LINK'; ignored
LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification

and

laf-os.lib(skia_surface.cpp.obj) : error LNK2001: unresolved external symbol "public: enum SkCodec::Result __thiscall SkCodec::getPixels(struct SkImageInfo const &,void *,unsigned int,struct SkCodec::Options const *)" (?getPixels@SkCodec@@QAE?AW4Result@1@ABUSkImageInfo@@PAXIPBUOptions@1@@Z)
laf-gfx.lib(region_skia.cpp.obj) : error LNK2001: unresolved external symbol "public: __thiscall SkRegion::SkRegion(void)" (??0SkRegion@@QAE@XZ)
laf-gfx.lib(region_skia.cpp.obj) : error LNK2001: unresolved external symbol "public: __thiscall SkRegion::SkRegion(class SkRegion const &)" (??0SkRegion@@QAE@ABV0@@Z)
laf-gfx.lib(region_skia.cpp.obj) : error LNK2001: unresolved external symbol "public: __thiscall SkRegion::SkRegion(struct SkIRect const &)" (??0SkRegion@@QAE@ABUSkIRect@@@Z)
laf-gfx.lib(region_skia.cpp.obj) : error LNK2001: unresolved external symbol "public: class SkRegion & __thiscall SkRegion::operator=(class SkRegion const &)" (??4SkRegion@@QAEAAV0@ABV0@@Z)
laf-gfx.lib(region_skia.cpp.obj) : error LNK2001: unresolved external symbol "public: bool __thiscall SkRegion::setRect(struct SkIRect const &)" (?setRect@SkRegion@@QAE_NABUSkIRect@@@Z)
laf-gfx.lib(region_skia.cpp.obj) : error LNK2001: unresolved external symbol "public: bool __thiscall SkRegion::intersects(struct SkIRect const &)const " (?intersects@SkRegion@@QBE_NABUSkIRect@@@Z)
laf-gfx.lib(region_skia.cpp.obj) : error LNK2001: unresolved external symbol "public: bool __thiscall SkRegion::contains(struct SkIRect const &)const " (?contains@SkRegion@@QBE_NABUSkIRect@@@Z)
laf-gfx.lib(region_skia.cpp.obj) : error LNK2001: unresolved external symbol "public: __thiscall SkRegion::Iterator::Iterator(class SkRegion const &)" (??0Iterator@SkRegion@@QAE@ABV1@@Z)
bin\aseprite.exe : fatal error LNK1120: 90 unresolved externals
ninja: build stopped: subcommand failed.

I’m using Windows 10 if that helps.
Any help at all is greatly appreciated.

I have solved the problem, thanks for everyone’s help :slight_smile:. I removed this:
-DSKIA_LIBRARY=C:\deps\skia\out\Release-x64\skia.lib
from the cmake command and it worked. In the instructions on GitHub it says to use that command option but it doesn’t work if I include it.

1 Like