#MSVC linker errors to stdlib functions

29 messages · Page 1 of 1 (latest)

vital inlet
#

When attempting to compile my project using the 141_xp toolset
I get these linker errors

1>cryptopp.lib(integer.cpp.obj) : error LNK2019: unresolved external symbol ___std_reverse_copy_trivially_copyable_1 referenced in function "void __cdecl std::_Reverse_copy_vectorized<1>(void const *,void const *,void *)" (??$_Reverse_copy_vectorized@$00@std@@YAXPBX0PAX@Z)
1>cryptopp.lib(dll.cpp.obj) : error LNK2019: unresolved external symbol ___std_mismatch_4@12 referenced in function "unsigned int __cdecl std::_Mismatch_vectorized<4>(void const * const,void const * const,unsigned int)" (??$_Mismatch_vectorized@$03@std@@YAIQBX0I@Z)
1>msvcrtd.lib(chandler4gs.obj) : error LNK2019: unresolved external symbol __except_handler4_common referenced in function __except_handler4

vcpkg has been set to use the windows-x86-static triplet for all deps
And the project has been set to use /MT(d)

When attempting to do it in Release mode, the errors are way larger
https://paste.ofcode.org/38UeSK3s9EVCxBurLUQMwZd

I've set the Debug mode to use the .lib files in vcpkg_installed\x86-windows-static\debug\lib and the Release mode to use the .lib files in \x86-windows-static\lib

Any idea what's causing these?

steady oliveBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

gentle needle
#

i think you're seeing these errors because of a C++ runtime library version mismatch.

#

The linker can't find the newer functions used by those libraries in your project's older runtime environment.

#

set VCPKG_PLATFORM_TOOLSET=v141_xp

#

could you try this in your powershell ↑↑

#

before installing the dependencies

#

then try vcpkg install cryptopp:x86-windows-static

vital inlet
vital inlet
#

I do set VCPKG_PLATFORM_TOOLSET=v141_xp

#

then go to the project root directory

#

use vcpkg install

#

because the default triplet is already x86-static, and I have a manifest

#

vcpkg that I use is the one bundled with VS 2022

tame plover
#

What version of C++ are you using

#

And are you building in debug or release

vital inlet
vital inlet
#

the first message is in debug mode

#

the pastebin is in release mode

vital inlet
#

but I don't know the why

#

vcpkg is supposed to install x86-static on v141_xp

vital inlet
#

OK so I found out what to do

#

I cloned the repo itself

#

compiled for 141_xp

#

then used the resulting static lib instead of vcpkg install

#

!solve