VS2022 build failure. link error with libiconv?
Any thoughts on this? Any help welcomed.
Win32 UNICODE build as cloned from Github.
NuGet reports libiconv is present:
All other packages are present and link as expected:
Truncated error report (all the rest is clean).
"
1>Unicode Selected
1>R:\src\cpp\hardware\TinyCAD\src\sqlite\CppSQLite3U.cpp(256,1): warning C4715: 'CppSQLite3DB::execDML': not all control paths return a value
1>sqlite3.c
1>NetList.obj : error LNK2019: unresolved external symbol _libiconv_open referenced in function "void __cdecl to_utf8(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,class std::basic_ofstream<char,struct std::char_traits
I had the same issues as you when using VC2022.
I suspect it may be due to VC2022 uses vc143 build env (and libraries), where as those being published via the NuGet package manager seemed to only support vc142 of libiconv/libjpeg/....
So, I ended up not using any of the NuGet packages and I used the vcpkg packages instead.
The ones I had to locally install were:
- vcpkg install libiconv:x86-windows
- vcpkg install libjpeg:x86-windows
- vcpkg install libjpeg-turbo:x86-windows
- vcpkg install libpng:x86-windows
- vcpkg install libssh2:x86-windows (there were some other dependencies that were also built/installed so I did not have to manually install them myself, like zlib)
Also, there was a change I had to make to XMLReader.cpp:152 to account for passing a const char into the iconv function call.
I haven't thoroughly tested it yet, but it did build and run. :)