Neither the template sample project in visual studio nor any project in the github examples compiles. The error messages mainly indicate there are some errors in the “tuple” and “utility” headers. I tried the C++ standard to default, 14 and 17, none works. Here is the error message compiling the template project:
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\utility(137,9): error : expected member name or ';' after declaration specifiers
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\utility(137,9): error : expected ')'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\utility(218,24): error : expected member name or ';' after declaration specifiers
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\utility(218,24): error : expected ')'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\xutility(63,31): error : '_To' does not refer to a value
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\tuple(273,9): error : expected member name or ';' after declaration specifiers
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\tuple(273,9): error : expected ')'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\tuple(351,5): error : non-static data member cannot be constexpr; did you intend to make it const?
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\tuple(351,24): error : member '_Tuple_conditional_explicit_v' declared as a template
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\tuple(351,79): error : expected ';' at end of declaration list
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\tuple(974,19): error : out-of-line definition of 'pair<_Ty1, _Ty2>' does not match any declaration in 'pair<_Ty1, _Ty2>'
1>C:\Program Files\Codeplay\ComputeCpp\include\SYCL/kernel.h(320,10): error : no matching constructor for initialization of 'std::pair<const void *, size_t>' (aka 'pair<const void *, unsigned long long>')
1>C:\Program Files\Codeplay\ComputeCpp\include\SYCL/kernel.h(324,10): error : no matching constructor for initialization of 'std::pair<const void *, size_t>' (aka 'pair<const void *, unsigned long long>')
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\ComputeCpp.targets(60,9): error MSB3721: The command ""C:\Program Files\Codeplay\ComputeCpp\bin\compute++.exe" -D_SIZE_T_DEFINED -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH -Wno-ignored-attributes -fdiagnostics-format=msvc -sycl -O2 -nobuiltininc -I"C:\Program Files\Codeplay\ComputeCpp\include" -I"C:\Program Files\Codeplay\ComputeCpp\include\image_library" -I"C:\Users\Peter\source\repos\ComputeCpp SYCL\ComputeCpp SYCL\\" -o"C:\Users\Peter\source\repos\ComputeCpp SYCL\ComputeCpp SYCL\main.sycl" -c main.cpp " exited with code 1.
1>Done building project "ComputeCpp SYCL.vcxproj" -- FAILED.
In this thread
The workaround works, but please also provides a solution to normal visual studio projects.