现在的位置: 首页 > 综合 > 正文

Visual studio 2012编译Tbb40关于std::Copy_exception的错误解决

2013年06月13日 ⁄ 综合 ⁄ 共 2384字 ⁄ 字号 评论关闭

问题:编译时出现错误:

d:\tbb40_20120613oss\include\tbb\tbb_exception.h(357) : error C2039: “copy_exception”: 不是“std”的成员

d:\tbb40_20120613oss\include\tbb\tbb_exception.h(357) : error C3861: “copy_exception”: 找不到标识符

 

搜索结果:http://software.intel.com/en-us/forums/showthread.php?t=105837

 

Visual Studio 2012

I'm trying out the release candidate of Visual Studio 2012. tbb_exception.h does not compile due to use of std::copy_exception(). I'm having a hard time finding any info on this method. Is it really part of the std namespace? Will VS2012 be supported soon?

Thanks,
Paul
 


Vladimir
Polin (Intel)
June 8, 2012 11:28 PM PDT

Rate
 

Visual Studio 2012

Hello, you are right, 

the issue is the same for clang (http://software.intel.com/en-us/forums/showthread.php?t=102603&o=a&s=lr), C++x0 std::copy_exception was renamed to std::make_exception_ptr
in final version of C++11 standard. So you need to either rename it in the header or define /DTBB_USE_CAPTURED_EXCEPTION=1 to not use exception_ptr like for old compilers.
We are working on how is better to support both cases at once (i.e. vs2010 and vs2012).
thanks for the report
--Vladimir
Update - details on the issue:
http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#1130
 


Sergey
Kostrov
June 9, 2012 4:22 PM PDT

Rate
 

Visual Studio 2012

Quoting
paul3579
I'm trying out the release candidate of Visual Studio 2012. tbb_exception.h does not compile due to use of std::copy_exception(). I'm having a hard time finding any info on this method. Is it really part of the std namespace?

I just done verifications with different versions/editions of Visual Studio and
MinGW. Here are results:

     - Visual Studio 2005 Professional Edition - 'copy_exception' is not supported

     - Visual Studio 2008 Express Edition - 'copy_exception' is not supported

     - Visual Studio 2010 Express Edition - 'copy_exception' is supported in 'exception' header file

     - MinGW v3.4.2 - 'copy_exception' is not supported

I don't think that Microsoft will remove that support in Visual Studio 2012.

 


简单解决办法(可能不规范):

更改该.h中

tbb_exception_ptr ( const captured_exception& src ) : my_ptr(std::copy_exception(src)) {}

tbb_exception_ptr ( const captured_exception& src ) : my_ptr(NULL) {}

问题解决,但可能爆异常时有问题!

抱歉!评论已关闭.