Linking errors when using parameter skia_enable_svg

120 views
Skip to first unread message

Kristian

unread,
Aug 4, 2021, 8:36:59 AM8/4/21
to skia-discuss
Hi,

when I try to build skia on Windows with these parameters (args.gn):

target_os = "win"
target_cpu = "x64"
clang_win = "C:\Program Files\LLVM"
is_debug = false
is_component_build = true
skia_enable_svg = true

I get some linking errors (see below). Any idea why?


lld-link: error: undefined symbol: public: __cdecl SkDOM::SkDOM(void)
>>> referenced by skia\modules\svg\src\SkSVGDOM.cpp:400
>>>               obj/modules/svg/src/svg.SkSVGDOM.obj:(public: class sk_sp<class SkSVGDOM> __cdecl SkSVGDOM::Builder::make(class SkStream &) const)

lld-link: error: undefined symbol: public: struct SkDOMNode const * __cdecl SkDOM::build(class SkStream &)
>>> referenced by skia\modules\svg\src\SkSVGDOM.cpp:401
>>>               obj/modules/svg/src/svg.SkSVGDOM.obj:(public: class sk_sp<class SkSVGDOM> __cdecl SkSVGDOM::Builder::make(class SkStream &) const)

lld-link: error: undefined symbol: public: struct SkDOMNode const * __cdecl SkDOM::getRootNode(void) const
>>> referenced by skia\modules\svg\src\SkSVGDOM.cpp:408
>>>               obj/modules/svg/src/svg.SkSVGDOM.obj:(public: class sk_sp<class SkSVGDOM> __cdecl SkSVGDOM::Builder::make(class SkStream &) const)

lld-link: error: undefined symbol: public: __cdecl SkDOM::~SkDOM(void)
>>> referenced by skia\modules\svg\src\SkSVGDOM.cpp:423
>>>               obj/modules/svg/src/svg.SkSVGDOM.obj:(public: class sk_sp<class SkSVGDOM> __cdecl SkSVGDOM::Builder::make(class SkStream &) const)

lld-link: error: undefined symbol: public: char const * __cdecl SkDOM::getName(struct SkDOMNode const *) const
>>> referenced by skia\modules\svg\src\SkSVGDOM.cpp:331
>>>               obj/modules/svg/src/svg.SkSVGDOM.obj:(class sk_sp<class SkSVGNode> __cdecl `anonymous namespace'::construct_svg_node(class SkDOM const &, struct `anonymous namespace'::ConstructionContext const &, struct SkDOMNode const *))
>>> referenced by skia\modules\svg\src\SkSVGDOM.cpp:338
>>>               obj/modules/svg/src/svg.SkSVGDOM.obj:(class sk_sp<class SkSVGNode> __cdecl `anonymous namespace'::construct_svg_node(class SkDOM const &, struct `anonymous namespace'::ConstructionContext const &, struct SkDOMNode const *))

lld-link: error: undefined symbol: public: enum SkDOM::Type __cdecl SkDOM::getType(struct SkDOMNode const *) const
>>> referenced by skia\modules\svg\src\SkSVGDOM.cpp:332
>>>               obj/modules/svg/src/svg.SkSVGDOM.obj:(class sk_sp<class SkSVGNode> __cdecl `anonymous namespace'::construct_svg_node(class SkDOM const &, struct `anonymous namespace'::ConstructionContext const &, struct SkDOMNode const *))

lld-link: error: undefined symbol: int __cdecl SkStrSearch(char const *const *, int, char const *const, unsigned __int64)
>>> referenced by skia\modules\svg\src\SkSVGDOM.cpp:367
>>>               obj/modules/svg/src/svg.SkSVGDOM.obj:(class sk_sp<class SkSVGNode> __cdecl `anonymous namespace'::construct_svg_node(class SkDOM const &, struct `anonymous namespace'::ConstructionContext const &, struct SkDOMNode const *))
>>> referenced by skia\modules\svg\src\SkSVGDOM.cpp:372
>>>               obj/modules/svg/src/svg.SkSVGDOM.obj:(class sk_sp<class SkSVGNode> __cdecl `anonymous namespace'::construct_svg_node(class SkDOM const &, struct `anonymous namespace'::ConstructionContext const &, struct SkDOMNode const *))
>>> referenced by skia\modules\svg\src\SkSVGDOM.cpp:462
>>>               obj/modules/svg/src/svg.SkSVGDOM.obj:(public: bool __cdecl SkSVGNode::setAttribute(char const *, char const *))
>>> referenced 1 more times

lld-link: error: undefined symbol: public: __cdecl SkDOM::AttrIter::AttrIter(class SkDOM const &, struct SkDOMNode const *)
>>> referenced by skia\modules\svg\src\SkSVGDOM.cpp:372
>>>               obj/modules/svg/src/svg.SkSVGDOM.obj:(class sk_sp<class SkSVGNode> __cdecl `anonymous namespace'::construct_svg_node(class SkDOM const &, struct `anonymous namespace'::ConstructionContext const &, struct SkDOMNode const *))

lld-link: error: undefined symbol: public: char const * __cdecl SkDOM::AttrIter::next(char const **)
>>> referenced by skia\modules\svg\src\SkSVGDOM.cpp:372
>>>               obj/modules/svg/src/svg.SkSVGDOM.obj:(class sk_sp<class SkSVGNode> __cdecl `anonymous namespace'::construct_svg_node(class SkDOM const &, struct `anonymous namespace'::ConstructionContext const &, struct SkDOMNode const *))
>>> referenced by skia\modules\svg\src\SkSVGDOM.cpp:372
>>>               obj/modules/svg/src/svg.SkSVGDOM.obj:(class sk_sp<class SkSVGNode> __cdecl `anonymous namespace'::construct_svg_node(class SkDOM const &, struct `anonymous namespace'::ConstructionContext const &, struct SkDOMNode const *))

lld-link: error: undefined symbol: public: struct SkDOMNode const * __cdecl SkDOM::getFirstChild(struct SkDOMNode const *, char const *const) const
>>> referenced by skia\modules\svg\src\SkSVGDOM.cpp:375
>>>               obj/modules/svg/src/svg.SkSVGDOM.obj:(class sk_sp<class SkSVGNode> __cdecl `anonymous namespace'::construct_svg_node(class SkDOM const &, struct `anonymous namespace'::ConstructionContext const &, struct SkDOMNode const *))

lld-link: error: undefined symbol: public: struct SkDOMNode const * __cdecl SkDOM::getNextSibling(struct SkDOMNode const *, char const *const) const
>>> referenced by skia\modules\svg\src\SkSVGDOM.cpp:376
>>>               obj/modules/svg/src/svg.SkSVGDOM.obj:(class sk_sp<class SkSVGNode> __cdecl `anonymous namespace'::construct_svg_node(class SkDOM const &, struct `anonymous namespace'::ConstructionContext const &, struct SkDOMNode const *))

lld-link: error: undefined symbol: public: static class SkString __cdecl SkOSPath::Dirname(char const *)
>>> referenced by skia\modules\svg\src\SkSVGImage.cpp:64
>>>               obj/modules/svg/src/svg.SkSVGImage.obj:(public: static struct SkSVGImage::ImageInfo __cdecl SkSVGImage::LoadImage(class sk_sp<class skresources::ResourceProvider> const &, class SkSVGIRI const &, struct SkRect const &, struct SkSVGPreserveAspectRatio))

lld-link: error: undefined symbol: public: static class SkString __cdecl SkOSPath::Basename(char const *)
>>> referenced by skia\modules\svg\src\SkSVGImage.cpp:64
>>>               obj/modules/svg/src/svg.SkSVGImage.obj:(public: static struct SkSVGImage::ImageInfo __cdecl SkSVGImage::LoadImage(class sk_sp<class skresources::ResourceProvider> const &, class SkSVGIRI const &, struct SkRect const &, struct SkSVGPreserveAspectRatio))

lld-link: error: undefined symbol: public: __cdecl SkTextBlobRunIterator::SkTextBlobRunIterator(class SkTextBlob const *)
>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29910\include\functional:938
>>>               obj/modules/svg/src/svg.SkSVGText.obj:(private: virtual void __cdecl std::_Func_impl_no_alloc<class `private: virtual struct SkRect __cdecl SkSVGText::onObjectBoundingBox(class SkSVGRenderContext const &) const'::`1'::<lambda_4>, void, class SkSVGRenderContext const &, class sk_sp<class SkTextBlob> const &, class SkPaint const *, class SkPaint const *>::_Do_call(class SkSVGRenderContext const &, class sk_sp<class SkTextBlob> const &, class SkPaint const *&&, class SkPaint const *&&))
>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29910\include\functional:938
>>>               obj/modules/svg/src/svg.SkSVGText.obj:(private: virtual void __cdecl std::_Func_impl_no_alloc<class `private: virtual struct SkRect __cdecl SkSVGText::onObjectBoundingBox(class SkSVGRenderContext const &) const'::`1'::<lambda_4>, void, class SkSVGRenderContext const &, class sk_sp<class SkTextBlob> const &, class SkPaint const *, class SkPaint const *>::_Do_call(class SkSVGRenderContext const &, class sk_sp<class SkTextBlob> const &, class SkPaint const *&&, class SkPaint const *&&))
>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29910\include\functional:938
>>>               obj/modules/svg/src/svg.SkSVGText.obj:(private: virtual void __cdecl std::_Func_impl_no_alloc<class `private: virtual class SkPath __cdecl SkSVGText::onAsPath(class SkSVGRenderContext const &) const'::`1'::<lambda_5>, void, class SkSVGRenderContext const &, class sk_sp<class SkTextBlob> const &, class SkPaint const *, class SkPaint const *>::_Do_call(class SkSVGRenderContext const &, class sk_sp<class SkTextBlob> const &, class SkPaint const *&&, class SkPaint const *&&))
>>> referenced 1 more times

lld-link: error: undefined symbol: public: void __cdecl SkTextBlobRunIterator::next(void)
>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29910\include\functional:938
>>>               obj/modules/svg/src/svg.SkSVGText.obj:(private: virtual void __cdecl std::_Func_impl_no_alloc<class `private: virtual struct SkRect __cdecl SkSVGText::onObjectBoundingBox(class SkSVGRenderContext const &) const'::`1'::<lambda_4>, void, class SkSVGRenderContext const &, class sk_sp<class SkTextBlob> const &, class SkPaint const *, class SkPaint const *>::_Do_call(class SkSVGRenderContext const &, class sk_sp<class SkTextBlob> const &, class SkPaint const *&&, class SkPaint const *&&))
>>> referenced by C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29910\include\functional:938
>>>               obj/modules/svg/src/svg.SkSVGText.obj:(private: virtual void __cdecl std::_Func_impl_no_alloc<class `private: virtual class SkPath __cdecl SkSVGText::onAsPath(class SkSVGRenderContext const &) const'::`1'::<lambda_5>, void, class SkSVGRenderContext const &, class sk_sp<class SkTextBlob> const &, class SkPaint const *, class SkPaint const *>::_Do_call(class SkSVGRenderContext const &, class sk_sp<class SkTextBlob> const &, class SkPaint const *&&, class SkPaint const *&&))

lld-link: error: undefined symbol: private: static void (__cdecl *const *const SkMatrix::gMapXYProcs)(class SkMatrix const &, float, float, struct SkPoint *)
>>> referenced by skia\include\core\SkMatrix.h:1918
>>>               skresources.lib(skresources.SkResources.obj):(private: static void (__cdecl * __cdecl SkMatrix::GetMapXYProc(enum SkMatrix::TypeMask))(class SkMatrix const &, float, float, struct SkPoint *))
>>> referenced by skia\include\core\SkMatrix.h:1922
>>>               skresources.lib(skresources.SkResources.obj):(private: void (__cdecl * __cdecl SkMatrix::getMapXYProc(void) const)(class SkMatrix const &, float, float, struct SkPoint *))

lld-link: error: undefined symbol: private: static void (__cdecl *const *const SkMatrix::gMapPtsProcs)(class SkMatrix const &, struct SkPoint *const, struct SkPoint const *const, int)
>>> referenced by skia\include\core\SkMatrix.h:1930
>>>               skresources.lib(skresources.SkResources.obj):(private: static void (__cdecl * __cdecl SkMatrix::GetMapPtsProc(enum SkMatrix::TypeMask))(class SkMatrix const &, struct SkPoint *const, struct SkPoint const *const, int))
>>> referenced by skia\include\core\SkMatrix.h:1934
>>>               skresources.lib(skresources.SkResources.obj):(private: void (__cdecl * __cdecl SkMatrix::getMapPtsProc(void) const)(class SkMatrix const &, struct SkPoint *const, struct SkPoint const *const, int))

lld-link: error: undefined symbol: bool __cdecl SkStrEndsWith(char const *const, char const *const)
>>> referenced by skia\include\core\SkString.h:148
>>>               skresources.lib(skresources.SkResources.obj):(public: bool __cdecl SkString::endsWith(char const *const) const)

lld-link: error: undefined symbol: bool __cdecl SkStrEndsWith(char const *const, char)
>>> referenced by skia\include\core\SkString.h:151
>>>               skresources.lib(skresources.SkResources.obj):(public: bool __cdecl SkString::endsWith(char) const)

lld-link: error: undefined symbol: public: __cdecl SkAnimCodecPlayer::SkAnimCodecPlayer(class std::unique_ptr<class SkCodec, struct std::default_delete<class SkCodec>>)
>>> referenced by skia\modules\skresources\src\SkResources.cpp:107
>>>               skresources.lib(skresources.SkResources.obj):(public: static class sk_sp<class skresources::MultiFrameImageAsset> __cdecl skresources::MultiFrameImageAsset::Make(class sk_sp<class SkData>, bool))

lld-link: error: too many errors emitted, stopping now (use /errorlimit:0 to see all errors)
[1716/1719] "C:\Program Files\LLVM/bin/lld-link.exe" /nologo /IMPLIB:./sktext.dll.lib /DLL /OUT:./sktext.dll /PDB:./sktext.dll.pdb @./sktext.dll.rsp
[1717/1719] "C:\Program Files\LLVM/bin/lld-link.exe" /nologo /IMPLIB:./skparagraph.dll.lib /DLL /OUT:./skparagraph.dll /PDB:./skparagraph.dll.pdb @./skparagraph.dll.rsp
ninja: build stopped: subcommand failed.

Micha

unread,
Jul 14, 2022, 2:32:06 AMJul 14
to skia-discuss
When building skia.dll / skia.dll.lib on Windows and linking against it from a Win32 Application, I get some of these linker errors too (e.g. SkStrEndsWith). Did you already found a way to fix this?
Reply all
Reply to author
Forward
0 new messages