Connie Zhang wrote:
> I recently upgrade boost version of a visual C++ program from an old version of 1_58_0 to 1_64_0.
> Compared to the original executable, the newly upgraded one runs very slow (more than 6 times
> longer) even I disable the debug mode and set the optimization to /ox in visual environment.
>
> The other difference between the old and the upgrade ones is the visual studio version. The old
> one is on 2010 and the new one 2013.
This problem sounds like one I had last year when upgrading a vendor library and from Visual Studio
2010 to 2012. I had persistent linker errors like this:
error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match
value 'MTd_StaticDebug'
I was surprised (and actually angry) when I learned the cause: The Visual C++ 2012 compiler silently
changes option /MT to /MTd if the preprocessor macro DEBUG or _DEBUG is set using /D. Some
vendor libraries I needed were compiled only with /MT, so the link would always fail. It made no
sense to me that a preprocessor macro definition should force a compiler option change like that.
You did say that you disabled debugging, but…
Are you defining either DEBUG or _DEBUG in the compiler command line? Try removing it if you do.
If you use “#ifdef DEBUG” in your code, consider adding your own text to the macro name, such as
“MY_PROJECT_DEBUG”. You can still debug your code without using /MTd by adding option /Zi or
something similar to the compiler and linker commands.
I hope this helps.
|+| M a r k |+|
Mark Stallard
Business Application Services
Global Business Services Information Technology
Raytheon Company
|