0

I have a C++ CLR wrapper project in Visual Studio 2022. The project platform was set for Win32 platform. Also, that works fine. but now, I need to set project for x64 platform. So, according to Win32 properties I set all properties for x64. then, I built the project. Next, I got this error:

Error   C1189   #error:  <future> is not supported when compiling with /clr or /clr:pure.   

I searched on the internet, unluckily, I didn't find any worthwhile solutions. For example some people said you should use forward declaration for std::future. It's good to know I didn't use any functions of std::future in my project. Is there any ways to solve it? Is it possible to have CLR project in x64 platform?

At this picture you can see the trouble and more information. enter image description here regards.

  • 1
    _"Is it possible to have CLR project in x64 platform?"_ It is possible if you do not use header directly or indirectly in managed code. – Revolver_Ocelot Oct 11 '22 at 10:06
  • As I said before. I do not use . – Milad Rasouli Oct 11 '22 at 12:53
  • 1
    As error state, you do. If you do not include it yourself, then one of other headers you include does (directly or indirectly, chain of includes can sometimes be quite deep). First of all, determine, which one does that. Then you can start looking for a solution. – Revolver_Ocelot Oct 11 '22 at 14:02
  • I think, it's a kind of bug from Visual Studio. because the Visual Studio take some errors with my other projects that the errors about boost – Milad Rasouli Oct 12 '22 at 05:19
  • 1
    Try re-adding the code and header files to find out where the error is coming from. – Minxin Yu - MSFT Oct 12 '22 at 08:50
  • 1
    [This](https://stackoverflow.com/a/1138045/21567) might help finding the include. – Christian.K Nov 09 '22 at 12:48

0 Answers0