CUDA 12.6 in MSVS - Error in limits file

Hi everyone
I currently try to compile a CUDA code in MSVS 2022 (Version 17.12.3) using CUDA Toolkit 12.6. Originally, the code was written using MSVS 2019 and CUDA Toolkit 10.1.

I now encounter the error that build errors are found in the limits files. See log below:

Column 1 Column 2 Column 3 Column 4 E F G H
Severity Code Description Project File Line Suppression State Details
Error C2143 syntax error: missing ‘)’ before ‘;’ CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 218
Error C2059 syntax error: ‘)’ CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 218
Error C2238 unexpected token(s) preceding ‘;’ CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 218
Error C1201 unable to continue after syntax error in class template definition CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 218
Error C2143 syntax error: missing ‘)’ before ‘;’ CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 218
Error C2059 syntax error: ‘)’ CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 218
Error C2238 unexpected token(s) preceding ‘;’ CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 218
Error C1201 unable to continue after syntax error in class template definition CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 218
Error C2143 syntax error: missing ‘)’ before ‘;’ CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 218
Error C2059 syntax error: ‘)’ CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 218
Error C2238 unexpected token(s) preceding ‘;’ CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 218
Error C1201 unable to continue after syntax error in class template definition CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 218
Error C2059 syntax error: ‘)’ CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 155
Error C2334 unexpected token(s) preceding ‘:’; skipping apparent function body CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 155
Error C2059 syntax error: ‘)’ CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 155
Error C2334 unexpected token(s) preceding ‘:’; skipping apparent function body CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 155
Error C2059 syntax error: ‘)’ CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 155
Error C2334 unexpected token(s) preceding ‘:’; skipping apparent function body CudaRuntime3 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include\cuda\std\detail\libcxx\include\limits 155

CUDA toolkit is installed (I can compile the standard kernel.cu code). Since the code is not intended for public disclosure I cannot show it to you. However, maybe someone has encountered similar issues and know the cause/solution for this problem.

Thank you and cheers

Does the error happens directly at the include? (So removing the remaining code still shows the error or you can use ´#error x` before or after the include to see, at which position it came from.
Are other files included first? Does it depend on those?

Thank you for your reply. We resolved the problem!

The issue was caused by a wrong recognition of the Item Type of the *.cpp files. They were recognized as C/C++ files but we had to redefine them as CUDA C/C++.

The project now builds correctly and releases a *.dll

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.