Skip to content
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

[MSVC] Serialization test failed due to error LNK2019: unresolved external symbol #322

Open
brianGriifin114 opened this issue Oct 11, 2024 · 1 comment

Comments

@brianGriifin114
Copy link

Hi , The MSVC testing team uses boost to test compiler issues. Recently we noticed that serialization test are failing .The error message as below:

A.cpp
msvc.link C:\gitP\boostorg\boost\amd64\boost\bin.v2\libs\serialization\test\test_array_text_archive.test\msvc-14.3\release\x86_64\threading-multi\test_array_text_archive.exe
   Creating library C:\gitP\boostorg\boost\amd64\boost\bin.v2\libs\serialization\test\test_array_text_archive.test\msvc-14.3\release\x86_64\threading-multi\test_array_text_archive.lib and object C:\gitP\boostorg\boost\amd64\boost\bin.v2\libs\serialization\test\test_array_text_archive.test\msvc-14.3\release\x86_64\threading-multi\test_array_text_archive.exp
test_array.obj : error LNK2019: unresolved external symbol "void __cdecl boost::filesystem::detail::path_traits::convert(char const *,char const *,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &,class std::codecvt<wchar_t,char,struct _Mbstatet> const *)" (?convert@path_traits@detail@filesystem@boost@@YAXPEBD0AEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@PEBV?$codecvt@_WDU_Mbstatet@@@6@@Z) referenced in function "char const * __cdecl boost::archive::test_filename(char const *,char *)" (?test_filename@archive@boost@@YAPEBDPEBDPEAD@Z)
test_array.obj : error LNK2019: unresolved external symbol "void __cdecl boost::filesystem::detail::path_traits::convert(wchar_t const *,wchar_t const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,class std::codecvt<wchar_t,char,struct _Mbstatet> const *)" (?convert@path_traits@detail@filesystem@boost@@YAXPEB_W0AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBV?$codecvt@_WDU_Mbstatet@@@6@@Z) referenced in function "char const * __cdecl boost::archive::test_filename(char const *,char *)" (?test_filename@archive@boost@@YAPEBDPEBDPEAD@Z)
test_array.obj : error LNK2019: unresolved external symbol "class boost::filesystem::path __cdecl boost::filesystem::detail::unique_path(class boost::filesystem::path const &,class boost::system::error_code *)" (?unique_path@detail@filesystem@boost@@YA?AVpath@23@AEBV423@PEAVerror_code@system@3@@Z) referenced in function "char const * __cdecl boost::archive::test_filename(char const *,char *)" (?test_filename@archive@boost@@YAPEBDPEBDPEAD@Z)
C:\gitP\boostorg\boost\amd64\boost\bin.v2\libs\serialization\test\test_array_text_archive.test\msvc-14.3\release\x86_64\threading-multi\test_array_text_archive.exe : fatal error LNK1120: 3 unresolved externals

These errors indicate that during compilation, the linker was unable to find the implementation of some functions in the boost::filesystem library. It is worth noting that the test failure of the serialization submodule occurs at the same time as the test failure of the filesystem submodule. I have already filed an issue boostorg/filesystem#329 to report the test failure of filesystem. However, I do not know if there is any connection between the two modules, so I cannot be sure that the test failure of serialization is caused by the test failure of filesystem.

refer test log for more detail . Thanks!
serialization-Test.log

@NEIL-smtg
Copy link

Having the same issue here, it appears that it's missing Boost.Filesystem linkage. After I added the path to boost_filesystem-vc143-mt-x64-1_87.lib in the linker command, this issue appears to be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants