-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
[openimageio[opencolorio] / libheif] Linking against OpenImageIO failed #13354
Comments
Hi @shauser67 |
Hi @NancyLi1013, I have created a simple "Hello World" project in Visual Studio 2019 to reproduce the problem (x64 / Debug / Multithreaded-Debug):
Additional include directories:
Additional defines:
Additional library directories:
Additional dependencies:
Although heif.lib is specified as an additional dependency the compiler detects the undefined symbols shown in my initial post. |
Sorry for the delay. I try to reproduce this issue on my local, but it was blocked by the error:
|
I suppose you haven't defined both OIIO_STATIC_DEFINE and OpenColorIO_STATIC. These defines are required if you want to link against static library versions of OpenImageIO instead of DLLs. Looking at heif.h I found a similiar define called LIBHEIF_STATIC_BUILD, but it doesn't remove the linker errors regarding libheif functions. I slighty modified the C++ example to match an example from OpenImageIO:
|
Thanks for your investigation. I only defined |
I have reproduced this issue. But there is no need to define these two definitions.
Just define this is enough. After I changed as static libraries, the error disappeared. Check Configuration properties -> Vcpkg -> Use static libraries -> Yes. I will try to fix this as soon as possible. |
Is there an update on this issue? I am having the very same issue: libheif static library is not chosen for linking. |
Sorry for the long delay. I will investigate this issue again. |
Thanks for looking into this, @NancyLi1013. I found a work around. The preprocessor value NOTE: the
Before Change:
After Change:
|
Hi @curtisgray Are you willing to create a PR to fix this issue? |
@NancyLi1013, I've created PR #14641 to address this issue. |
Hi, Vcpkg installed latest dependencies for OIIO. Rebuilt OIIO vcpkg 2.3.7.2#4 Builds OK - C:\Users\chris\vcpkg>vcpkg install openimageio[core,gif,openjpeg,webp,libraw,webp]:x64-windows-static Total elapsed time: 3.867 min The package openimageio provides CMake targets:
C:\Users\chris\vcpkg> The problem when static linking my app - heif.lib(heif_decoder_libde265.cc.obj) : error LNK2019: unresolved external symbol __imp_de265_get_version referenced in function "char const * __cdecl libde265_plugin_name(void)" (?libde265_plugin_name@@YAPEBDXZ) All 20 unresolved externals (LNK1120: ) errors refer to : heif.lib(heif_decoder_libde265.cc.obj) . Here's the OIIO static lib link line - -L C:\Users\chris\vcpkg\installed\x64-windows-static\lib -l OpenImageIO -l OpenImageIO_Util -l OpenColorIO -l lcms2 -l bz2 -l libpng16 -l zlib -l libwebm -l lzma -l tinyxml -l libszip -l bz2 -l gif -l freetype -l jpeg -l turbojpeg -l raw_r -l openjp2 -l webp -l libhdf5_hl -l libhdf5 -l tiff -l jasper -l Half-2_5 -l IexMath-2_5 -l Iex-2_5 -l IlmImf-2_5 -l Imath-2_5 -l IlmThread-2_5 -l IlmImfUtil-2_5 -l assimp-vc142-mt -l x265-static -l libde265 -l heif -l squish -l webpdecoder -l webpdemux -l boost_thread-vc140-mt -l boost_filesystem-vc140-mt -l boost_system-vc140-mt I also tried changing libheif-config.cmake - Before Change: set_target_properties(heif PROPERTIES After Change: set_target_properties(heif PROPERTIES Reinstall openimageio using the commands - C:\Users\chris\vcpkg>vcpkg remove openimageio[core,gif,openjpeg,webp,libraw,webp]:x64-windows-static C:\Users\chris\vcpkg>vcpkg install openimageio[core,gif,openjpeg,webp,libraw,webp]:x64-windows-static Build : SUCCESS But when linking, exact same link errors (as listed above). Is there an option for omitting HEIF & e265 when building OIIO static. Please, any ideas. Thank you, |
Hi, I forgot to add that vcpkg cache folders were removed after editing libheif-config.cmake, and before re-installing openimageio. Thank you, |
Hi guys, can anyone test whether #22818 fix this issue? |
Host Environment
To Reproduce
Linking my application against openimageio worked fine until recently when a new dependency to libheif was introduced. Although I added heif.lib to both the debug and release configuration there are a number of unresolved external symbols. Maybe a configuration problem? Thanks for any help in advance!
Failure logs
The text was updated successfully, but these errors were encountered: