Exiv2 / exiv2

Image metadata library and tools
http://www.exiv2.org/
Other
922 stars 278 forks source link

unresolved external symbol _BrotliDecoderCreateInstance #2451

Open tester0077 opened 1 year ago

tester0077 commented 1 year ago

Trying to use the latest libExiv2 code under Win 10, MSVC 2019, built the MSVC sln files using CMake GUI for a 32-bit static build When linking libexiv2 to my app, I get the following warnings (unsure whether these are related, or not) error report:

13>D:\pkg\C++\MSVC2019\exiv2\include\exiv2\value.hpp(1273,1): warning C4127: conditional expression is constant (compiling source file wxMetaWriteMetadata.cpp)
13>D:\pkg\C++\MSVC2019\exiv2\include\exiv2\value.hpp(1273,1): message : consider using 'if constexpr' statement instead (compiling source file wxMetaWriteMetadata.cpp)
13>D:\pkg\C++\MSVC2019\exiv2\include\exiv2\value.hpp(1626): message : see reference to function template instantiation 'I Exiv2::ValueType<Exiv2::Rational>::rational_to_integer_helper<int64_t>(size_t) const' being compiled
13>        with
13>        [
13>            I=int64_t
13>        ] (compiling source file wxMetaWriteMetadata.cpp)
13>D:\pkg\C++\MSVC2019\exiv2\include\exiv2\value.hpp(1626): message : see reference to function template instantiation 'I Exiv2::ValueType<Exiv2::Rational>::rational_to_integer_helper<int64_t>(size_t) const' being compiled
13>        with
13>        [
13>            I=int64_t
13>        ] (compiling source file wxMetaWriteMetadata.cpp)
13>exiv2.lib(bmffimage.obj) : error LNK2019: unresolved external symbol _BrotliDecoderCreateInstance referenced in function "public: __thiscall Exiv2::BrotliDecoderWrapper::BrotliDecoderWrapper(void)" (??0BrotliDecoderWrapper@Exiv2@@QAE@XZ)
13>exiv2.lib(bmffimage.obj) : error LNK2019: unresolved external symbol _BrotliDecoderDestroyInstance referenced in function "public: __thiscall Exiv2::BrotliDecoderWrapper::~BrotliDecoderWrapper(void)" (??1BrotliDecoderWrapper@Exiv2@@QAE@XZ)
13>exiv2.lib(bmffimage.obj) : error LNK2019: unresolved external symbol _BrotliDecoderDecompressStream referenced in function __catch$?boxHandler@BmffImage@Exiv2@@AAE_KAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@W4PrintStructureOption@2@_KI@Z$0
13>exiv2.lib(bmffimage.obj) : error LNK2019: unresolved external symbol _BrotliDecoderGetErrorCode referenced in function __catch$?boxHandler@BmffImage@Exiv2@@AAE_KAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@W4PrintStructureOption@2@_KI@Z$0
13>exiv2.lib(bmffimage.obj) : error LNK2019: unresolved external symbol _BrotliDecoderErrorString referenced in function __catch$?boxHandler@BmffImage@Exiv2@@AAE_KAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@W4PrintStructureOption@2@_KI@Z$0
13>D:\pkg\wx\MSVC2019\_3.1.4_2019\wxMeta\Win32\DebUniStat\wxMeta.exe : fatal error LNK1120: 5 unresolved externals

Found a similar (seemingly unrelated) report at: https://bugs.gentoo.org/650104

tester0077 commented 1 year ago

I can get past the error if I uncheck the CMake option EXIV2_ENABLE_BROTLI.

Curious thing, though, the conan install missing reported:

Installing (downloading, building) binaries...
brotli/1.0.9: Already installed!
expat/2.4.9: Already installed!
gtest/1.12.1: Already installed!
zlib/1.2.13: Already installed!

I will raise a separate question for the warning, though

neheb commented 1 year ago

@tester0077 those warnings are interesting. can you provide more of them?

piponazo commented 1 year ago

I'll try to reproduce the issue on my windows machine.

kmilos commented 1 year ago

I think you'll need to also link brotlidec.lib and brotlicommon.lib yourself in your app project, no?

neheb commented 1 year ago

Is this still an issue?