LNK1104 when CUDA in separate translation units built on Visual Studio

I couldn’t build my VS project because of a linking error. The error happens when I separate CUDA code into separate translation units. I could successfully build it when all the CUDA code was in one .cu file before. I read this document(https://wrf.ecse.rpi.edu/wiki/ParallelComputingSpring2015/cuda/nvidia/doc/pdf/CUDA_Compiler_Driver_NVCC.pdf) and I added -rdc=true as a flag in Visual studio. Yet, I still got a linking error Severity Code Description Project File Line Suppression State
Error LNK1104 cannot open file ‘C:\Users\Lijin\daedalus-compute\build\src_fw\applications\comp_solid\comp_cu\CMakeFiles\comp_solid_cu.dir\Debug\comp_solid_cu_intermediate_link.obj’ comp_solid_cu C:\Users\Lijin\daedalus-compute\build\src_fw\applications\comp_solid\comp_cu\LINK 1

My GPU is NVIDIA GeForce GTX 1050 Ti with Max-Q Design.
My Nsight Version is 2021.2.1
My CUDA Toolkit is 11.4.

I found out that comp_solid_cu_intermediate_link.obj wasn’t output by the nvcc command
“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\bin\nvcc.exe” --use_fast_math --ptxas-options=-v -dc -m64 -ccbin “$(VCInstallDir)Tools/MSVC/$(VCToolsVersion)/bin/Host$(Platform)/$(PlatformTarget)” -dlink C:/Users/Lijin/daedalus-compute/daedalus-build/src_fw/applications/comp_solid/comp_cu/CMakeFiles/comp_solid_cu.dir/__/$(Configuration)/comp_solid_cu_generated_solid.cu.obj -o C:/Users/Lijin/daedalus-compute/daedalus-build/src_fw/applications/comp_solid/comp_cu/CMakeFiles/comp_solid_cu.dir/$(Configuration)/comp_solid_cu_intermediate_link.obj

I tried the same nvcc command in the command line and it output nothing. That’s the reason why it couldn’t be found. But why is the nvcc -dlink command output nothing without an error?