-
Notifications
You must be signed in to change notification settings - Fork 155
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
CMake - "lib" prefix bug in implibs of MSVC #476
Comments
Could you please check that CMake adds |
I did the test adding: #ifndef BOOST_DYN_LINK
#error "Preprocessor not defined"
#endif Regardless of whether you add |
Meh, you would not be able to test config/include/boost/config/auto_link.hpp Lines 520 to 522 in a1cf5d5
BOOST_DYN_LINK seems to be an 'internal' macro that a library which uses auto_link.hpp configures, the user controlled macros are: BOOST_ALL_DYN_LINK and BOOST_<WHATEVER>_DYN_LINK (BOOST_THREAD_DYN_LINK in your case). It means that set(Boost_USE_STATIC_LIBS OFF) should either make CMake add BOOST_ALL_DYN_LINK on everything or target_link_libraries(ProjName PUBLIC Boost::thread) should add BOOST_THREAD_DYN_LINK .
There are related tickets on CMake bug tracker: |
Introduction
Recently, I reported an issue in the
Boost.Thread
module where the msvc linker intended to link a file that doesn't even exist. The file was:libboost_thread-vc143-mt-gd-x64-1_78.lib
It has also been reported, in the same issue, that the prefix
lib*
is used for mingw, even though I don't have any mingw installation and only have Visual Studio and msvc.Solution of Bug
The solution was to add
Boost::disable_autolinking
intarget_link_libraries
:This solved the problem, but it wasn't supposed to have the
lib*
prefix when using CMake with msvc, it was to have linked correctly without having to specifyBoost::disable_autolinking
.The most likely cause would be a bug of this module that, when treating the prefix of the library on the Windows platform with msvc, ended up accidentally placing this prefix, being that it was supposed to be in mingw.
Extra Information
C:\boost_1_79_0
.The following instructions are used:
Logs
Configuration log:
Build log:
Steps to reproduce
BOOST_ROOT
;find_package
(as above),include_directories
(${Boost_INCLUDE_DIRS}
),target_link_libraries
(Boost::thread
);(I tried to be as brief as possible.)
The text was updated successfully, but these errors were encountered: