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

Boost\libs\pool\test failed due to link error on MSVC #34

Open
QuellaZhang opened this issue Jul 31, 2020 · 3 comments
Open

Boost\libs\pool\test failed due to link error on MSVC #34

QuellaZhang opened this issue Jul 31, 2020 · 3 comments

Comments

@QuellaZhang
Copy link

Issue description:
Found Boost\libs\pool\test boostorg/boost@38d8e0e link error in a future release of MSVC. Could you please take a look?

Reproduce steps:

  1. git clone -c core.autocrlf=true --recursive ​https://github.com/boostorg/boost.git Boost\src
  2. open a VS 2017 x64 command prompt and browse to Boost\src
  3. .\bootstrap
  4. .\b2 headers variant=release --build-dir=..\out\x64rel address-model=64
  5. .\b2 variant=release --build-dir=..\out\x64rel address-model=64
  6. .\b2 -j4 variant=release --build-dir=..\out\x64rel libs\pool\test

ErrorMessage:
Creating library .\pool_msvc_compiler_bug_test.lib and object .\pool_msvc_compiler_bug_test.exp
pool_msvc_compiler_bug_test.obj : error LNK2019: unresolved external symbol "public: __cdecl boost::archive::codecvt_null<wchar_t>::codecvt_null<wchar_t>(unsigned __int64)" (??0?$codecvt_null@_W@archive@boost@@qeaa@_K@Z) referenced in function "public: void __cdecl boost::archive::codecvt_null<wchar_t>::`default constructor closure'(void)" (??_F?$codecvt_null@_W@archive@boost@@QEAAXXZ)
.\pool_msvc_compiler_bug_test.exe : fatal error LNK1120: 1 unresolved externals

@MichaelAnthonyP96
Copy link

I too am having a similar issue when statically linking boost::serialization to my application:

cmake_pch.obj : error LNK2019: unresolved external symbol "public: __cdecl boost::archive::codecvt_null<wchar_t>::codecvt_null<wchar_t>(unsigned __int64)" (??0?$codecvt_null@_W@archive@boost@@qeaa@_K@Z) referenced in function "public: v
oid __cdecl boost::archive::codecvt_null<wchar_t>::`default constructor closure'(void)" (??_F?$codecvt_null@_W@archive@boost@@QEAAXXZ)

I have tried building Boost 1.74.0 and 1.73.0 with ICU (1.67_1) support on Windows using MSVC2019 and then statically linking to my application. It would seem that sometime after Boost 1.70.0 symbol visibility was tinkered with.

@Jimmy-Hu
Copy link

I have the similar issue as @MichaelAnthonyP96 mentioned.

The environment is:

  • OS: Windows 10 Pro version 21H1 build 19043.1110 with Windows Feature Experience Pack 120.2212.3530.0

  • IDE: Microsoft Visual Studio 2019 Version 16.10.4

  • library version: Boost 1.76.0 statically linking with cmake

The part of adding boost libs in cmake:

# Add boost library
# Reference: https://github.com/Microsoft/vcpkg/issues/4188
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED OFF)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(BOOST 76.0 REQUIRED COMPONENTS test serialization)
find_path(BOOST_INCLUDE_DIR boost)
include_directories(${BOOST_INCLUDE_DIR})
target_link_libraries(TinyDIP Boost::boost ${BOOST_LIBRARIES})

@UMU618
Copy link

UMU618 commented Sep 26, 2022

1>C:\dev\boost_1_80_0\boost\beast\core\detail\type_traits.hpp(67,32): error C4996: 'std::aligned_storage<8,8>': warning STL4034: std::aligned_storage and std::aligned_storage_t are deprecated in C++23. Prefer alignas(T) std::byte t_buff[sizeof(T)]. You can define _SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING or _SILENCE_ALL_CXX23_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include\type_traits(1070,1): message : see declaration of 'std::aligned_storage'
1>C:\dev\boost_1_80_0\boost\beast\core\detail\variant.hpp(32): message : see reference to class template instantiation 'boost::beast::detail::aligned_union<1,const boost::beast::http::detail::chunk_size::value_type *,const boost::asio::const_buffer *,const boost::beast::http::chunk_crlf::value_type *,boost::beast::detail::buffers_cat_view_iterator_base::past_end>' being compiled
1>C:\dev\boost_1_80_0\boost\beast\core\detail\variant.hpp(32): message : see reference to alias template instantiation 'boost::beast::detail::aligned_union_t<1,const boost::beast::http::detail::chunk_size::value_type*,const boost::asio::const_buffer*,const boost::beast::http::chunk_crlf::value_type*,boost::beast::detail::buffers_cat_view_iterator_base::past_end>' being compiled
1>C:\dev\boost_1_80_0\boost\beast\core\impl\buffers_cat.hpp(127): message : see reference to class template instantiation 'boost::beast::detail::variant<const boost::beast::http::detail::chunk_size::value_type *,const boost::asio::const_buffer *,const boost::beast::http::chunk_crlf::value_type *,boost::beast::detail::buffers_cat_view_iterator_base::past_end>' being compiled
1>C:\dev\boost_1_80_0\boost\beast\http\chunk_encode.hpp(251): message : see reference to class template instantiation 'boost::beast::buffers_cat_view<boost::beast::http::detail::chunk_size,boost::asio::const_buffer,boost::beast::http::chunk_crlf>::const_iterator' being compiled
1>C:\dev\boost_1_80_0\boost\beast\core\detail\type_traits.hpp(67,18): error C4996: 'std::aligned_storage<8,8>::type': warning STL4034: std::aligned_storage and std::aligned_storage_t are deprecated in C++23. Prefer alignas(T) std::byte t_buff[sizeof(T)]. You can define _SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING or _SILENCE_ALL_CXX23_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
1>C:\dev\boost_1_80_0\boost\beast\websocket\detail\decorator.hpp(65,9): error C4996: 'std::aligned_storage<48,8>::type': warning STL4034: std::aligned_storage and std::aligned_storage_t are deprecated in C++23. Prefer alignas(T) std::byte t_buff[sizeof(T)]. You can define _SILENCE_CXX23_ALIGNED_STORAGE_DEPRECATION_WARNING or _SILENCE_ALL_CXX23_DEPRECATION_WARNINGS to acknowledge that you have received this warning.

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

4 participants