Do you want to work on this issue?
You can request for a bounty in order to promote it!
pandagl/freetype not linking with brotli+bzip2 (win32) #314
nlapinski posted onGitHub
Bug There seems to be a problem with freetype for some reason the freetype xmake package fails to link bzip2 and brotli (in pandagl), I'm not sure if this a xmake issue.
vendor\LCUI\lib\pandagl\xmake.lua
error: freetype.lib(sfnt.c.obj) : error LNK2019: unresolved external symbol BrotliDecoderDecompress referenced in function woff2_decompress
freetype.lib(ftbzip2.c.obj) : error LNK2019: unresolved external symbol BZ2_bzDecompressInit referenced in function FT_Stream_OpenBzip2
freetype.lib(ftbzip2.c.obj) : error LNK2019: unresolved external symbol BZ2_bzDecompress referenced in function ft_bzip2_file_fill_output
freetype.lib(ftbzip2.c.obj) : error LNK2019: unresolved external symbol BZ2_bzDecompressEnd referenced in function ft_bzip2_file_done
build\windows\x64\release\app.exe : fatal error LNK1120: 4 unresolved externals
:panda_face: :broken_heart:
To Reproduce Steps to reproduce the behavior:
npm install -g @lcui/cli
git clone https://github.com/lcui-dev/lcui-quick-start.git
cd lcui-quick-start
git submodule sync --recursive
git submodule update --init --recursive
npm install
lcui build & xmake run
Expected behavior
LCUI should likely have automatically resolved the dependency via freetypes package but this fixes it.
Adding this to the pandagl xmake.lua in the global scope: (vendor\LCUI\lib\pandagl\xmake.lua)
if is_plat("windows") then
add_requires("bzip2","brotli", {optional = false,configs = {shared = false}})
end
and this in the target pandagl fixes it:
if is_plat("windows") then
add_packages("bzip2","brotli")
end
It seems this dependency should be available by freetype - I'm not sure why it isnt? I'm simply not familiar enough with xmake to know the real cause. Adding brotli+bzip2 fixes it though - after that everything builds and links as expected :thumbsup: :panda_face:
I can put a pull in of this if desired - I didn't yet because I wasn't sure if it was a xmake problem, or if this should be fixed in a alternate way/config.
Screenshots
Environment
- LCUI version: 3.0.0-a (https://gitee.com/lc-soft/LCUI.git)
- Build tools: VS2022 dev prompt.
- OS and version: Windows 10