VI-MEAN icon indicating copy to clipboard operation
VI-MEAN copied to clipboard

nvcc fatal : redefinition of argument 'std'

Open arnabsinha opened this issue 7 years ago • 9 comments

/usr/local/cuda/bin/nvcc -M -D__CUDACC__ /home/arnab/codes/3D_with_drone/VI_MEAN_ws/src/VI-MEAN/stereo_mapper/src/calc_cost.cu -o /home/arnab/codes/3D_with_drone/VI_MEAN_ws/build/VI-MEAN/stereo_mapper/CMakeFiles/stereo_mapper.dir/src/stereo_mapper_generated_calc_cost.cu.o.NVCC-depend -ccbin /usr/bin/cc -m64 --std c++11 -DROS_BUILD_SHARED_LIBS=1 -DROS_PACKAGE_NAME="stereo_mapper" -DROSCONSOLE_BACKEND_LOG4CXX -Xcompiler ,"-DEIGEN_DONT_PARALLELIZE","-O3","-Wall","-g" -std=c++11 -O3 -gencode arch=compute_61,code=sm_61 -DNVCC -I/usr/local/cuda/include -I/home/arnab/codes/3D_with_drone/VI_MEAN_ws/devel/include -I/opt/ros/kinetic/include -I/opt/ros/kinetic/share/xmlrpcpp/cmake/../../../include/xmlrpcpp -I/opt/ros/kinetic/include/opencv-3.3.1 -I/opt/ros/kinetic/include/opencv-3.3.1/opencv -I/usr/include -I/usr/include/eigen3 -I/usr/local/cuda/include nvcc fatal : redefinition of argument 'std' CMake Error at stereo_mapper_generated_calc_cost.cu.o.cmake:207 (message): Error generating /home/arnab/codes/3D_with_drone/VI_MEAN_ws/build/VI-MEAN/stereo_mapper/CMakeFiles/stereo_mapper.dir/src/./stereo_mapper_generated_calc_cost.cu.o

VI-MEAN/stereo_mapper/CMakeFiles/stereo_mapper.dir/build.make:1265: recipe for target 'VI-MEAN/stereo_mapper/CMakeFiles/stereo_mapper.dir/src/stereo_mapper_generated_calc_cost.cu.o' failed make[2]: *** [VI-MEAN/stereo_mapper/CMakeFiles/stereo_mapper.dir/src/stereo_mapper_generated_calc_cost.cu.o] Error 1

arnabsinha avatar Jan 11 '18 06:01 arnabsinha

When I remove "-std=c++11" from CXX_FLAGS, I do not get the above error, but I am stuck with the following error:

VI_MEAN_ws/src/VI-MEAN/stereo_mapper/src/tic_toc.h:22:20: error: 'std::chrono' has not been declared end = std::chrono::system_clock::now(); VI_MEAN_ws/src/VI-MEAN/stereo_mapper/src/tic_toc.h:23:14: error: 'std::chrono' has not been declared std::chrono::duration elapsed_seconds = end - start; VI_MEAN_ws/src/VI-MEAN/stereo_mapper/src/stereo_mapper_node.cpp:80:19: error: 'id' does not name a type for (auto id : id_set_r) etc.

Henceforth, it can be concluded that the code base depends heavily on c11 features. Therefore, I am back to the original problem.

arnabsinha avatar Jan 11 '18 06:01 arnabsinha

I catch the problem the same as yours,how did you solve it?

xiaobainixi avatar Apr 25 '18 01:04 xiaobainixi

@arnabsinha @tiantiandabaojian I catch the problem the same as yours,how did you solve it?

cumtchenchang avatar Jun 27 '18 02:06 cumtchenchang

@cumtchenchang 没用这个,没调通,自己重写了一个

xiaobainixi avatar Jun 27 '18 09:06 xiaobainixi

@重写的stereo_mapper吗?能方便加微信或者qq沟通吗?

cumtchenchang avatar Jun 27 '18 09:06 cumtchenchang

@cumtchenchang 没重写这个,太复杂了 就重写了一个双目求视差并制作三维图的小程序

xiaobainixi avatar Jun 29 '18 05:06 xiaobainixi

@tiantiandabaojian 抱歉这么晚还来打扰你,我根据你的思路调试一直出问题,请问能够分享下你的代码吗?或者私下沟通.

cumtchenchang avatar Aug 20 '18 02:08 cumtchenchang

@cumtchenchang 代码写的很乱,就用的OPENCV的SGBM做的,代码的话去我GITHUB上吧

xiaobainixi avatar Aug 20 '18 08:08 xiaobainixi

just remove -std=c++11 in the CUDA_NVCC_FLAGS. it conflicts with the prior setting in CMAKE_CXX_FLAGS

brbzjl avatar Jan 08 '19 13:01 brbzjl