I am trying to build a CUDA library, while trying to build the library I’m getting MSB3721 error. This issue is very ambiguous, the issue is not occurring in one code but is occurring in a different code. The configurations of both the codes are same (even the code is same). I am using CUDA 11.8 with Visual studio 2022 and MSVC 2019 compiler for c++.
It would be really helpful if someone can help me resolve this issue, I am attaching both the solutions along with this post, along with the screenshots of the build outputs I got.
retargeting to cuda 12.6 worked, However I tried to retarget to CUDA 12.4 earlier and that gave the same error as well.
I was using CUDA 11.8 because the code base was built on 11.8 and the problem shared here is a minimized version.
Thank you for your help, but I would still like to know why there is ambiguity, it would be great if you could help me with the reason so that in future such errors can be minimized.