0
votes

I have a Problem when attempting to compile my project that uses boost libraries.

The error I get is:

1>f:\server\packages\boost.1.60.0.0\lib\native\include\boost\thread\future.hpp(156): error C3646: 'policy_': unknown override specifier
1>f:\server\packages\boost.1.60.0.0\lib\native\include\boost\thread\future.hpp(156): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\server\packages\boost.1.60.0.0\lib\native\include\boost\thread\future.hpp(396): error C2061: syntax error: identifier 'wait_until'
1>f:\server\packages\boost.1.60.0.0\lib\native\include\boost\thread\future.hpp(414): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>f:\server\packages\boost.1.60.0.0\lib\native\include\boost\thread\future.hpp(421): error C2988: unrecognizable template declaration/definition
1>f:\server\packages\boost.1.60.0.0\lib\native\include\boost\thread\future.hpp(421): error C2059: syntax error: 'this'

and more compiling error about future.hpp.....

I tried to reinstall the Windows SDK and also the Visual Studio and it didnt help in both cases.

I thought it can be about wrong include paths so i check the macros in the project properties. I found that in the 'Include Directories' i have $(VC_IncludePath);$(WindowsSDK_IncludePath);

That evaluated to:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\um C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\shared C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\winrt C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\Include\um

and in the first path from above I have the file 'future'...

Im using:

  • Visual studio 15
  • Windows 10 SDK version 10.0.10240.0
  • boost libraries version 1.60.0.0

It should be noted that the same project is compiling to my teammates, so its probably something about settings or includes but not about the code itself.

1

1 Answers

0
votes

So the problem was that the boost package on my computer was corrupted.

Reinstalling it on the project (through the visual) did not help because it just took it from the cache that is on my computer (C:\Users\ofir\.nuget\packages\boost) and not really downloaded from the internet. My problem was that the cache was corrupted - the files were not downloaded right from some reason.

The solution was to update the packages that is on my computer:

To do this I deleted the folder C:\Users\ofir\.nuget\packages\boost\1.60.0 and rebuilded my project - it redownloaded the package.

You can also use commands - https://docs.microsoft.com/en-us/nuget/consume-packages/reinstalling-and-updating-packages