I created skia.dll and associated import library skia.dll.lib using three different ways:
- as described here, using clang (see args.gn below)
-
same, but using msvc
-
using vcpkg skia package (easiest way)
All succesful, but when I create a Win32-Application (Visual Studio 22) and link against skia.dll.lib, I get unresolved exernals from ms linker. Struggled for days now with this, so any help greatly appreciated. See all details below.
------------ Source code from Visual Studio Win32-App
#include "SkiaCreateCanvas.h"
#include "skia/core/SkMatrix.h"
#include "skia/core/SkString.h"
bool SkiaCreateCanvas() {
SkMatrix m = SkMatrix::Scale(1.2f, 2.3f);
SkString s;
return false;
}
Note that SkMatrix::Scale gets resolved with no problems, also the SkString constructor.
----------- Unresolved Externals
2>SkiaCreateCanvas.obj : error LNK2019: unresolved external symbol "bool __cdecl SkStrEndsWith(char const * const,char const * const)" (?SkStrEndsWith@@YA_NQEBD0@Z) referenced in function "public: bool __cdecl SkString::endsWith(char const * const)const " (?endsWith@SkString@@QEBA_NQEBD@Z)
2>SkiaCreateCanvas.obj : error LNK2019: unresolved external symbol "bool __cdecl SkStrEndsWith(char const * const,char)" (?SkStrEndsWith@@YA_NQEBDD@Z) referenced in function "public: bool __cdecl SkString::endsWith(char)const " (?endsWith@SkString@@QEBA_ND@Z)
2>SkiaCreateCanvas.obj : error LNK2001: unresolved external symbol "private: static void (__cdecl*const * const SkMatrix::gMapXYProcs)(class SkMatrix const &,float,float,struct SkPoint *)" (?gMapXYProcs@SkMatrix@@0QBQ6AXAEBV1@MMPEAUSkPoint@@@ZB)
2>SkiaCreateCanvas.obj : error LNK2001: unresolved external symbol "private: static void (__cdecl*const * const SkMatrix::gMapPtsProcs)(class SkMatrix const &,struct SkPoint * const,struct SkPoint const * const,int)" (?gMapPtsProcs@SkMatrix@@0QBQ6AXAEBV1@QEAUSkPoint@@QEBU2@H@ZB)
-----------------
args.gn for method 1 to build skia (Release configuration)
clang_win = "C:\Program Files\LLVM"
is_official_build = true
is_component_build = true
is_debug = false
skia_use_system_expat = false
skia_use_system_libjpeg_turbo = false
skia_use_system_libpng = false
skia_use_system_libwebp = false
skia_use_system_zlib = false
skia_use_system_icu = false
skia_use_system_harfbuzz = false
skia_enable_svg = false