folks it took me fucking 3 days to sort the problem and guess what the problem was!!!
remove previous gcc-9 and g++-9 by :
sudo update-alternatives --remove gcc /usr/bin/gcc-9
you need to install gcc-7 and g++-7 :
sudo apt-get install gcc-7 g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 50
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
!!! cuda 10.1 requires gcc-7 !!!
cuda should be : nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/freenect2
make
make install
sudo cp ../platform/linux/udev/90-kinect2.rules /etc/udev/rules.d/
./bin/Protonect (DONT USE SUDO)
!!! cuda 10.1 requires gcc-7 !!!
Uncheck Driver, CUDA Toolkit 10.1, CUDA Demo Suite 10.1. CUDA Documentation 10.1 (only CUDA Samples 10.1 should be checked)
i hope someone find this useful..thanks