
I am trying to get boost asio to work with my code (which is using 4 byte struct member alignment and _cdecl calling convention). I get the following error when calling asio::async_write: Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention. What am I missing? I have read everything on ABI that I can find: http://www.boost.org/development/separate_compilation.html I changed boost\config\abi\msvc_prefix.hpp to use #pragma pack(push,4). I also am using the command line option for bjam: cxxflags="/Zp4 /Gd" The Microsoft documentation seems to indicate that the /Zp should override the #pragma if the #pragma is larger or equal: http://msdn.microsoft.com/en-us/library/ms253935.aspx http://msdn.microsoft.com/en-us/library/46t77ak2.aspx Any help would be greatly appreciated, Brian