Reputation: 201
I am learning the boost library for future use in my x64 console application on windows. I tried the simplest example provided here:
I want the boost library built to meet the following conditions:
I read the instruction at that webpage and searched many other pages and tried many build command such as:
bjam --build-type=complete toolset=msvc-10.0 threading=multi link=static address-model=64
b2 variant=release --build-type=complete architecture=x86 address-model=64 stage
b2 runtime-link=static variant=release address-model=64
Finally, I built the small visual studio project successfully in x64|Debug mode. However, when I tried the Release mode I get errors like:
1>libboost_regex-vc120-mt-sgd-1_59.lib(instances.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in Temp.obj
1>libboost_regex-vc120-mt-sgd-1_59.lib(instances.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in Temp.obj
1>libboost_regex-vc120-mt-sgd-1_59.lib(regex.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in Temp.obj
1>libboost_regex-vc120-mt-sgd-1_59.lib(regex.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in Temp.obj
1>libboost_regex-vc120-mt-sgd-1_59.lib(regex_traits_defaults.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in Temp.obj
1>libboost_regex-vc120-mt-sgd-1_59.lib(regex_traits_defaults.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in Temp.obj
1>libboost_regex-vc120-mt-sgd-1_59.lib(static_mutex.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in Temp.obj
1>libboost_regex-vc120-mt-sgd-1_59.lib(static_mutex.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in Temp.obj
1>libboost_regex-vc120-mt-sgd-1_59.lib(w32_regex_traits.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in Temp.obj
1>libboost_regex-vc120-mt-sgd-1_59.lib(w32_regex_traits.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in Temp.obj
1>libboost_regex-vc120-mt-sgd-1_59.lib(regex_raw_buffer.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in Temp.obj
1>libboost_regex-vc120-mt-sgd-1_59.lib(regex_raw_buffer.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in Temp.obj
1>libcpmtd.lib(stdthrow.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in Temp.obj
1>libcpmtd.lib(stdthrow.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MT_StaticRelease' in Temp.obj
1>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
I'm using Visual Studio 2013. It seems the "sgd" in "libboost_regex-vc120-mt-sgd-1_59.lib(regex.obj)" indicates its a debug library. I searched the %BOOST_ROOT%\stage\lib. As with libboost_regex, I have:
"C:\Program Files\boost\boost_1_59_0\stage\lib\libboost_regex-vc120-s-1_59.lib"
"C:\Program Files\boost\boost_1_59_0\stage\lib\libboost_regex-vc120-sgd-1_59.lib"
"C:\Program Files\boost\boost_1_59_0\stage\lib\libboost_regex-vc120-mt-1_59.lib"
"C:\Program Files\boost\boost_1_59_0\stage\lib\libboost_regex-vc120-mt-s-1_59.lib"
"C:\Program Files\boost\boost_1_59_0\stage\lib\libboost_regex-vc120-mt-sgd-1_59.lib"
"C:\Program Files\boost\boost_1_59_0\stage\lib\libboost_regex-vc120-mt-gd-1_59.lib"
I didn't specify libboost_regex-vc120-mt-sgd-1_59.lib for visual studio, it selected by visual studio automatically. So, I think I either failed to built the real required lib or I need to set the project property somehow.
Upvotes: 1
Views: 1921