开发者

strstreambuf Deprecated in Visual C++ 2010 - is it still possible to link to it?

As per http://msdn.microsoft.com/en-us/library/h21twfw7(v=VS.100).aspx (for Visual Studio 2010) strstreambuf is deprecated. I was of the notion that deprecated meant that the declaration/definitions were still available but will be obsoleted (or removed) from the library in near future. But attempting to link to the class fails with a Visual C++ 2010 project. This question is two part:

  • Could someone confirm for me that strstreambuf has really been dropped completely from Visual C++ 2010 libraries? Running some brief diagnostics, I am not able to find the definitions in the "C:\Program Files\Microsoft Visual Studio 10.0\VC\lib\msvcprt.lib" (for VS2010), whereas the definition was present in "C:\Program Files\Microsoft Visual Studio 8\VC\lib\msvcprt.lib" (for VS2005). To find out if the definition is provided, I used dumpbin.exe on the .lib. I also checked "C:\Program Files\Microsoft Visual Studio 10.0\VC\include\strstream" and noted that the _CRTIMP2_PURE (aka __declspec( dllimport ) ) keyword, exporting the c开发者_C百科lass, was gone in 2010.
  • Can I still link to strstreambuf even though it is deprecated in Visual C++ 2010, from a Visual C++ 2010 project?

A little background on my needs:

  • I use a 3rd party proprietary library that links to strstreambuf. The proprietary lib was probably built using Visual C++ 2005 and my project is currently in Visual C++ 2005 also.
  • While upgrading my project to Visual C++ 2010, we realized we couldn't link to the 3rd party proprietary library since strstreambuf is no longer provided by Visual C++ 2010.

Thanks


The reason you can't link a C++ library built in VS2005 with VS2010 is not because of strstreambuf being deprecated or not, but because the runtime library binaries changed for the new compiler version. Part of it is that several parts of the C++ standard library have been changed over to being header only.

It's a really, really bad idea to link C++ code built with one compiler with a runtime library for another compiler; you really want to make sure that you build everything that gets statically linked with the same compiler version as mayhem is likely to ensue otherwise.

Your best (only) hope is to get the supplier of said 3rd party library to cough up a version built with VS2010.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜