[chrono] Issues with _ITERATOR_DEBUG_LEVEL
Hi there, compiling with the latest trunk version gives me the following linker error with the chrono lib: libboost_chrono-vc100-mt-1_51.lib(chrono.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in Factory.obj Usually the solution is to recompile the lib with _ITERATOR_DEBUG_LEVEL=2 but the problem preservers. Can someone tell what wrong with compiling boost with: bjam -j8 --toolset=msvc --without-mpi variant=debug link=static runtime-link=shared define=_CRT_NONSTDC_NO_DEPRECATE define=_CRT_SECURE_NO_DEPRECATE define=_SCL_SECURE_NO_DEPRECATE define="_ITERATOR_DEBUG_LEVEL=2" stage I mean, is the define="_ITERATOR_DEBUG_LEVEL=2" syntactically correct? Thanks, Christian
Here the answer:
On Thu, Aug 9, 2012 at 10:15 PM, Christian Henning
Hi there, compiling with the latest trunk version gives me the following linker error with the chrono lib:
libboost_chrono-vc100-mt-1_51.lib(chrono.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in Factory.obj
Usually the solution is to recompile the lib with _ITERATOR_DEBUG_LEVEL=2 but the problem preservers. Can someone tell what wrong with compiling boost with:
bjam -j8 --toolset=msvc --without-mpi variant=debug link=static runtime-link=shared define=_CRT_NONSTDC_NO_DEPRECATE define=_CRT_SECURE_NO_DEPRECATE define=_SCL_SECURE_NO_DEPRECATE define="_ITERATOR_DEBUG_LEVEL=2" stage
I mean, is the define="_ITERATOR_DEBUG_LEVEL=2" syntactically correct?
This is correct ( using the " ). The dumpbin tool can be used to verify that _ITERATOR_DEBUG_LEVEL is set to 2. Christian
On 08/10/2012 04:15 AM, Christian Henning wrote:
Hi there, compiling with the latest trunk version gives me the following linker error with the chrono lib:
libboost_chrono-vc100-mt-1_51.lib(chrono.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in Factory.obj
Your code is compiled in debug, and you're trying to link with the release version of the library. This is just asking for problems. Link against the debug version of chrono.
On Thu, Aug 09, 2012 at 10:15:01PM -0400, Christian Henning wrote:
Hi there, compiling with the latest trunk version gives me the following linker error with the chrono lib:
libboost_chrono-vc100-mt-1_51.lib(chrono.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in Factory.obj
Usually the solution is to recompile the lib with _ITERATOR_DEBUG_LEVEL=2 but the problem preservers. Can someone tell what wrong with compiling boost with:
bjam -j8 --toolset=msvc --without-mpi variant=debug link=static runtime-link=shared define=_CRT_NONSTDC_NO_DEPRECATE define=_CRT_SECURE_NO_DEPRECATE define=_SCL_SECURE_NO_DEPRECATE define="_ITERATOR_DEBUG_LEVEL=2" stage
Have you've disabled autolinking and are linking manually to the Boost libraries? What is your intent with defining _ITERATOR_DEBUG_LEVEL=2? Is it just trying to smash errors you don't know where they're from, or is it intentional to get iterator debugging in release mode? Your bjam command line builds the debug library, but your link command line indicates that you're linking against the release library. If you haven't messed around with the autolinker functionality, that means that your code is a Release build, and thus, links against the Release boost library. libboost_chrono-vc100-mt-1_51.lib : static Boost library with release runtime libboost_chrono-vc100-mt-gd-1_51.lib : static Boost library with debug runtime If you want to change the properties of how the release Boost build builds, you should probably build your build with variant=release. -- Lars Viklund | zao@acc.umu.se
Hi,
Have you've disabled autolinking and are linking manually to the Boost libraries?
No, I'm working with some prep scripts that generate project solutions for various platforms. It's all based on CMake and I just mismatched release and debug version. I think the main reason for my email was that I wasn't sure if I need to put the compiler symbol ( _ITERATOR_DEBUG_LEVEL=2 ) inside quotation marks on Windows machines. I have now learned that I can use the dumpbin tool to double check that.
What is your intent with defining _ITERATOR_DEBUG_LEVEL=2? Is it just trying to smash errors you don't know where they're from, or is it intentional to get iterator debugging in release mode?
I had an linker error complaining that _ITERATOR_DEBUG_LEVEL needs to be set to 2 to be able to link successfully with another library. Otherwise linking fails due to the linker directive: /FAILIFMISMATCH
Your bjam command line builds the debug library, but your link command line indicates that you're linking against the release library.
Yes, that was my error. Thanks for your and Mathias's time. Christian
On 08/13/2012 05:10 PM, Christian Henning wrote:
I think the main reason for my email was that I wasn't sure if I need to put the compiler symbol ( _ITERATOR_DEBUG_LEVEL=2 ) inside quotation marks on Windows machines.
I have now learned that I can use the dumpbin tool to double check that.
_ITERATOR_DEBUG_LEVEL=2 is automatically set by Visual C++ when compiling in debug mode.
Hi Mathias,
On Tue, Aug 14, 2012 at 6:28 AM, Mathias Gaunard
On 08/13/2012 05:10 PM, Christian Henning wrote:
I think the main reason for my email was that I wasn't sure if I need to put the compiler symbol ( _ITERATOR_DEBUG_LEVEL=2 ) inside quotation marks on Windows machines.
I have now learned that I can use the dumpbin tool to double check that.
_ITERATOR_DEBUG_LEVEL=2 is automatically set by Visual C++ when compiling in debug mode.
Is that also true when building with bjam? Because I had to specify that setting on the command line. Christian
On 08/14/2012 02:54 PM, Christian Henning wrote:
Hi Mathias,
On Tue, Aug 14, 2012 at 6:28 AM, Mathias Gaunard
wrote: On 08/13/2012 05:10 PM, Christian Henning wrote:
I think the main reason for my email was that I wasn't sure if I need to put the compiler symbol ( _ITERATOR_DEBUG_LEVEL=2 ) inside quotation marks on Windows machines.
I have now learned that I can use the dumpbin tool to double check that.
_ITERATOR_DEBUG_LEVEL=2 is automatically set by Visual C++ when compiling in debug mode.
Is that also true when building with bjam? Because I had to specify that setting on the command line.
Yes. It is set in the standard library headers.
participants (3)
-
Christian Henning
-
Lars Viklund
-
Mathias Gaunard