[ 
https://issues.apache.org/jira/browse/THRIFT-2139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13772823#comment-13772823
 ] 

Alex Loukissas commented on THRIFT-2139:
----------------------------------------

Just ran into this problem and there are 2 fixes required for this:

1. Include StdThreadFactory.cpp into the list of compiled files in 
libthrift.vcxproj
2. Conditionally compile either BoostThreadFactory or StdThreadFactory, based 
on what config.h points to. My solution was to guard both files with the 
corresponding #ifdef.

Finally, to build for MSVC2012, you can just pass the /p:PlatformToolset=v110 
in your MSBuild invocation. I can provide the simple patch for 1,2 above.
                
> MSVC 2012 Error - Cannot compile due to BoostThreadFactory
> ----------------------------------------------------------
>
>                 Key: THRIFT-2139
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2139
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9.1
>         Environment: MSVC 2012 x64
>            Reporter: Chris Stylianou
>            Priority: Blocker
>              Labels: c++, msvc, thrift
>
> Errors given are:
> bq.error C2664: 'std::thread::id::id(const std::thread &)' : cannot convert 
> parameter 1 from 'boost::thread::id' to 'const std::thread &'     
> C:\Users\chris\Desktop\workspace\build\thrift\thrift-0.9.1\lib\cpp\src\thrift\concurrency\BoostThreadFactory.cpp
>         101     1       libthrift
> bq.error C2664: 'std::thread::id::id(const std::thread &)' : cannot convert 
> parameter 1 from 'boost::thread::id' to 'const std::thread &'     
> C:\Users\chris\Desktop\workspace\build\thrift\thrift-0.9.1\lib\cpp\src\thrift\concurrency\BoostThreadFactory.cpp
>         165     1       libthrift

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to