Hello everyone,
I'm working on a Windows 10 system using Visual Studio 2022 as my IDE. I installed the Boost library and integrated it into my Visual Studio project using the following commands:
vcpkg install boost
vcpkg integrate install
However, I'm encountering an issue. Whenever I include either of the following lines in my project:
#include <boost/variant.hpp>
#include <boost/algorithm/string.hpp>
I get the following error:
Severity Code Description Project File Line Suppression State
Error identifier "__builtin_FUNCSIG" is undefined D:\code\tool\test\vcpkg\installed\x64-windows\include\boost\throw_exception.hpp 224
Here are the detailed messages from the Visual Studio 2022 Output window:
1> D:\code\tool\test\vcpkg\installed\x64-windows\include\boost/throw_exception.hpp(224): error : identifier "__builtin_FUNCSIG" is undefined
1>
1> 1 error detected in the compilation of "E:/code/yhello.cu".
1> yhello.cu
1> D:\Visual studio\install_root\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 11.7.targets(790,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_52,compute_52\" --use-local-env -ccbin "D:\Visual studio\install_root\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\HostX64\x64" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\include" -I"D:\code\tool\test\vcpkg\installed\x64-windows\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -g -DWIN32 -DWIN64 -D_DEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /Fdx64\Debug\vc143.pdb /FS /Zi /RTC1 /MDd " -o "E:\code\x64\Debug\yhello.cu.obj" "E:\code\yhello.cu"” exited with code 2.
1> Task "CudaCompile" execution - FAILED.
I think that the issue might be resolved by using an older version of the Boost library, specifically Boost 1.70.0. However, I've found it challenging to install this specific version using vcpkg, as it defaults to installing the latest Boost version.
I'm using Visual Studio 2022 and not Visual Studio Code, which makes it less straightforward to use JSON configuration files or CMake scripts directly. I prefer a simpler method to install the Boost library and integrate it with Visual Studio so that I can develop and debug my project directly within the IDE.
Could someone guide me on how to install Boost 1.70.0 and integrate it into Visual Studio 2022?
Thank you for your help!