-
Notifications
You must be signed in to change notification settings - Fork 211
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
Windows linker error LNK2019: unresolved external symbol __imp_avifGainMapMetadataDoubleToFractions referenced in function avifJPEGParseGainMapXMPProperties #2339
Comments
This linker error is strange because all the linker warnings before it are the same problem but the linker somehow fixes them up and merely emits warnings. Also, the linker error is gone if I move the definitions of two gainmap-related functions from src/avif.c to src/gainmap.c, as I did in 4a4ff64. (I reverted that commit later because it would have required Chrome to build src/gainmap.c.) I haven't figured out what is wrong. I am going to fix what the linker warns about: the source files in avif_apps_internal.lib should not be compiled with |
I found that only the gain map experimental feature needs to be enabled to reproduce the linker error:
|
Add a CI workflow for building shared libraries with local dependencies on Windows. Run on merge only. Enable experimental features except AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP. When #2339 is fixed, enable AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP.
In shared library builds (-DBUILD_SHARED_LIBS=ON), compile the source files in the avif_apps_internal static library without -DAVIF_DLL. Also link avif_obj with the m and Threads::Threads libraries in the PRIVATE scope instead of the PUBLIC scope. Fix AOMediaCodec#2339.
In shared library builds (-DBUILD_SHARED_LIBS=ON), compile the source files in the avif_apps_internal static library without -DAVIF_DLL. Also link avif_obj with the m and Threads::Threads libraries in the PRIVATE scope instead of the PUBLIC scope. Fix AOMediaCodec#2339.
In shared library builds (-DBUILD_SHARED_LIBS=ON), compile the source files in the avif_apps_internal static library without -DAVIF_DLL. Also link avif_obj with the m and Threads::Threads libraries in the PRIVATE scope instead of the PUBLIC scope. Fix #2339.
Enable AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP in ci-windows-shared-local.yml. AOMediaCodec#2339 has been fixed.
Enable AVIF_ENABLE_EXPERIMENTAL_GAIN_MAP in ci-windows-shared-local.yml. #2339 has been fixed.
I verified on my Windows laptop that this is fixed by commit cde6fcd. Our new CI workflow ci-windows-shared-local.yml also verified this has been fixed. I still don't know why only |
@jzern @maryla-uc @vrabaud
This is a strange linker error on Windows when doing a shared library build (
-DBUILD_SHARED_LIBS=ON
). I can only reproduce it when all experimental features are enabled.To reproduce the linker error, run these commands:
We get a linker error, with a lot of linker warnings before it, like the following, when linking some tests:
The text was updated successfully, but these errors were encountered: