View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0016091 | CMake | CMake | public | 2016-05-03 02:38 | 2016-06-10 14:31 | ||||
Reporter | LCID Fire | ||||||||
Assigned To | Roger Leigh | ||||||||
Priority | normal | Severity | major | Reproducibility | always | ||||
Status | closed | Resolution | moved | ||||||
Platform | PC | OS | Windows | OS Version | 8.1 | ||||
Product Version | CMake 3.5.2 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0016091: RelWithDebInfo links Boost debug libraries | ||||||||
Description | Since switching to 3.5, Boost is trying to link against e.g. libboost_system-vc140-mt-gd-1_60.lib for RelWithDebInfo. This of course fails because iterator level and other symbols differ. Linker errors: error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in files.obj error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in files.obj fatal error LNK1104: cannot open file 'libboost_filesystem-vc140-mt-1_60.lib' | ||||||||
Steps To Reproduce | Boost_DEBUG prints: _boost_TEST_VERSIONS = 1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33 Boost_USE_MULTITHREADED = ON Boost_USE_STATIC_LIBS = ON Boost_USE_STATIC_RUNTIME = OFF Boost_ADDITIONAL_VERSIONS = Boost_NO_SYSTEM_PATHS = ON Declared as CMake or Environmental Variables: BOOST_ROOT = BOOST_INCLUDEDIR = C:/boost/lib BOOST_LIBRARYDIR = C:/boost/lib/lib64-msvc-14.0 _boost_TEST_VERSIONS = 1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33 location of version.hpp: C:/boost/lib/boost/version.hpp version.hpp reveals boost 1.60.0 guessed _boost_COMPILER = -vc140 _boost_MULTITHREADED = -mt _boost_RELEASE_ABI_TAG = - _boost_DEBUG_ABI_TAG = -gd _boost_LIBRARY_SEARCH_DIRS_RELEASE = C:/boost/lib/lib64-msvc-14.0;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH_boost_LIBRARY_SEARCH_DIRS_DEBUG = C:/boost/lib/lib64-msvc-14.0;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH Searching for FILESYSTEM_LIBRARY_RELEASE: libboost_filesystem-vc140-mt-1_60;libboost_filesystem-vc140-mt;libboost_filesystem-mt-1_60;libboost_filesystem-mt;libboost_filesystem Boost_LIBRARY_DIR_RELEASE = C:/boost/lib/lib64-msvc-14.0 _boost_LIBRARY_SEARCH_DIRS_RELEASE = C:/boost/lib/lib64-msvc-14.0;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH Searching for FILESYSTEM_LIBRARY_DEBUG: libboost_filesystem-vc140-mt-gd-1_60;libboost_filesystem-vc140-mt-gd;libboost_filesystem-mt-gd-1_60;libboost_filesystem-mt-gd;libboost_filesystem-mt;libboost_filesystem Boost_LIBRARY_DIR_DEBUG = C:/boost/lib/lib64-msvc-14.0 _boost_LIBRARY_SEARCH_DIRS_DEBUG = C:/boost/lib/lib64-msvc-14.0;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH Searching for SYSTEM_LIBRARY_RELEASE: libboost_system-vc140-mt-1_60;libboost_system-vc140-mt;libboost_system-mt-1_60;libboost_system-mt;libboost_system Boost_LIBRARY_DIR_RELEASE = C:/boost/lib/lib64-msvc-14.0 _boost_LIBRARY_SEARCH_DIRS_RELEASE = C:/boost/lib/lib64-msvc-14.0;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH Searching for SYSTEM_LIBRARY_DEBUG: libboost_system-vc140-mt-gd-1_60;libboost_system-vc140-mt-gd;libboost_system-mt-gd-1_60;libboost_system-mt-gd;libboost_system-mt;libboost_system Boost_LIBRARY_DIR_DEBUG = C:/boost/lib/lib64-msvc-14.0 _boost_LIBRARY_SEARCH_DIRS_DEBUG = C:/boost/lib/lib64-msvc-14.0;NO_DEFAULT_PATH;NO_CMAKE_FIND_ROOT_PATH Boost_FOUND = 1 | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
Relationships | |
Relationships |
Notes | |
(0041015) LCID Fire (reporter) 2016-05-03 06:28 |
The example: find_package(Boost 1.56 REQUIRED COMPONENTS date_time filesystem iostreams) add_executable(foo foo.cc) target_link_libraries(foo Boost::date_time Boost::filesystem Boost::iostreams) Does not seem to work with RelWithDebInfo. The new imported targets seem invalid for that configuration. |
(0041016) LCID Fire (reporter) 2016-05-03 07:27 |
Adding: get_property( BLUB TARGET Boost::filesystem PROPERTY IMPORTED_LOCATION_RELEASE) set_property( TARGET Boost::filesystem PROPERTY IMPORTED_LOCATION_RELWITHDEBINFO ${BLUB} ) after find_package( Boost ) fixes the problem. In general it seems the way FindBoost sets up the imported targets is insufficient. |
(0041018) Brad King (manager) 2016-05-03 08:18 |
For reference, the imported targets were added here: FindBoost: Add imported targets https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3f9b081f [^] |
(0041019) Brad King (manager) 2016-05-03 08:23 |
Another approach may be to set the MAP_IMPORTED_CONFIG_RELWITHDEBINFO target property to map it to one of the other imported configurations: https://cmake.org/cmake/help/v3.5/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.html [^] https://cmake.org/cmake/help/v3.5/variable/CMAKE_MAP_IMPORTED_CONFIG_CONFIG.html [^] This is meant specifically for the case when the current project has a different set of configurations than the imported project built with. However, it is also meant to be set by project code and not by the creator of the imported target. FindBoost may need to be taught to populate the RelWithDebInfo configuration itself. This convention may then need to be propagated to all the other find modules that provide imported targets. |
(0042996) Kitware Robot (administrator) 2016-06-10 14:29 |
Resolving issue as `moved`. This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2016-05-03 02:38 | LCID Fire | New Issue | |
2016-05-03 06:28 | LCID Fire | Note Added: 0041015 | |
2016-05-03 07:27 | LCID Fire | Note Added: 0041016 | |
2016-05-03 08:17 | Brad King | Assigned To | => Roger Leigh |
2016-05-03 08:17 | Brad King | Status | new => assigned |
2016-05-03 08:18 | Brad King | Note Added: 0041018 | |
2016-05-03 08:23 | Brad King | Note Added: 0041019 | |
2016-06-10 14:29 | Kitware Robot | Note Added: 0042996 | |
2016-06-10 14:29 | Kitware Robot | Status | assigned => resolved |
2016-06-10 14:29 | Kitware Robot | Resolution | open => moved |
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |