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

[package] freetype/2.11.1: unresolved external symbols #9285

Closed
bugproof opened this issue Feb 6, 2022 · 7 comments
Closed

[package] freetype/2.11.1: unresolved external symbols #9285

bugproof opened this issue Feb 6, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@bugproof
Copy link

bugproof commented Feb 6, 2022

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: freetype/2.11.1
  • Operating System+version: Windows 11
  • Compiler+version: MSVC 2022
  • Conan version: conan 1.45.0
  • Python version: Python 3.8.2

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

Configuration for profile default:

[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=17
build_type=Release
[options]
[conf]
[build_requires]
[env]

Steps to reproduce (Include if Applicable)

Logs (Include/Attach if Applicable)

Click to expand log
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_create_read_struct referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_set_longjmp_fn referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_create_info_struct referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_read_info referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_set_expand_gray_1_2_4_to_8 referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_set_palette_to_rgb referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_set_tRNS_to_alpha referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_set_gray_to_rgb referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_set_filler referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_set_packing referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_set_interlace_handling referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_set_strip_16 referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_read_update_info referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_read_image referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_read_end referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_destroy_read_struct referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_get_error_ptr referenced in function error_callback
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_set_read_fn referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_get_io_ptr referenced in function read_data_from_FT_Stream
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_set_read_user_transform_fn referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_error referenced in function read_data_from_FT_Stream
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_get_valid referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol png_get_IHDR referenced in function Load_SBit_Png
freetype.lib(sfnt.obj) : error LNK2019: unresolved external symbol BrotliDecoderDecompress referenced in function woff2_decompress
freetype.lib(ftgzip.obj) : error LNK2019: unresolved external symbol inflate referenced in function FT_Gzip_Uncompress
freetype.lib(ftgzip.obj) : error LNK2019: unresolved external symbol inflateEnd referenced in function FT_Gzip_Uncompress
freetype.lib(ftgzip.obj) : error LNK2019: unresolved external symbol inflateReset referenced in function ft_gzip_file_reset
freetype.lib(ftgzip.obj) : error LNK2019: unresolved external symbol inflateInit2_ referenced in function FT_Gzip_Uncompress
freetype.lib(ftbzip2.obj) : error LNK2019: unresolved external symbol BZ2_bzDecompressInit referenced in function ft_bzip2_file_init
freetype.lib(ftbzip2.obj) : error LNK2019: unresolved external symbol BZ2_bzDecompress referenced in function ft_bzip2_file_fill_output
freetype.lib(ftbzip2.obj) : error LNK2019: unresolved external symbol BZ2_bzDecompressEnd referenced in function ft_bzip2_file_done
@bugproof bugproof added the bug Something isn't working label Feb 6, 2022
@bugproof bugproof changed the title [package] freetype/2.11.1: unresolved external symbols libpng [package] freetype/2.11.1: unresolved external symbols Feb 6, 2022
@SpaceIm
Copy link
Contributor

SpaceIm commented Feb 6, 2022

Steps to reproduce? I'm pretty sure you don't properly link dependencies of static freetype.

@bugproof
Copy link
Author

bugproof commented Feb 7, 2022

Steps to reproduce? I'm pretty sure you don't properly link dependencies of static freetype.

Just added it like every other conan dependency and added Freetype::Freetype to target_link_libraries (using CMake integration). I eventually got it to work with some struggling but I had to add every dependency manually PNG::PNG Brotli::Brotli Freetype::Freetype BZip2::BZip2 was hoping just Freetype::Freetype will add it's dependencies automatically for me.

@SpaceIm
Copy link
Contributor

SpaceIm commented Feb 7, 2022

Transitive dependencies are propagated, so Freetype::Freetype should be enough. It's not clear what you mean by "CMake integration". Share exact conan commands, conanfile and CMakeLists. Maybe you rely on cmake_find_package_multi only, and forget cmake_find_package.

@bugproof
Copy link
Author

bugproof commented Feb 7, 2022

cmake_find_package_multi

That's the only one I use in conanfile.py

generators = "cmake_find_package_multi"

Tried it again now and turns out I was missing find_package(Freetype CONFIG REQUIRED) I'm pretty sure I added it before and it didn't work, Well nevermind it works now and I can't re-produce it anymore. Thank you for quick answers 🍺 I'm gonna close it.

@bugproof bugproof closed this as completed Feb 7, 2022
@bugproof
Copy link
Author

bugproof commented Feb 7, 2022

Turns out the CONFIG was crucial for it to work. find_package(Freetype REQUIRED) without it didn't work.

@SpaceIm
Copy link
Contributor

SpaceIm commented Feb 7, 2022

You should use both generators actually: cmake_find_package & cmake_find_package_multi. So you could write find_package(Freetype REQUIRED).
What happen is that Find module files have precedence over Config files by default. So FindFreetype.cmake (which is not very robust) took precedence over config file generated by conan. This is why it's better to always use both generators, to avoid to rely on Find files shipped by CMake when they exist, because they are fragile (specially when dependencies are static).

@bugproof
Copy link
Author

bugproof commented Feb 7, 2022

Noted, good to know. I'm gonna add cmake_find_package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants