编译darknet_ros 报/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h(432): error: expected a ";"错误。

[ 5%] Building NVCC (Device) object CMakeFiles/nheqminer_cuda_tromp.dir///cuda_tromp/nheqminer_cuda_tromp_generated_equi_miner.cu.o
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h(432): error: identifier "nullptr" is undefined

/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h(432): error: expected a ";"

...

Error limit reached.
100 errors detected in the compilation of "/tmp/tmpxft_00003777_00000000-17_equi_miner.compute_61.cpp1.ii".

Compilation terminated.

解决方案:

在cmakelist.txt 中加入

set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};--disable-warnings;--ptxas-options=-v;-use_fast_math;-lineinfo;-std=c++11)

即可解决

你可能感兴趣的:(Ubuntu,c++)