Ask Your Question

/usr/include/host_config.h:82:2: error: #error -- unsupported GNU version! gcc 4.7 and up are not supported!

asked 2013-10-01 07:21:48 -0500

pachamama gravatar image

After compile opencv with standard options, make will abort with error 2 and the following message is displayed on sdte

Built target pch_Generate_opencv_core [ 0%] Building NVCC (Device) object modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./ In file included from /usr/lib/nvidia-cuda-toolkit/include/cuda_runtime.h:59:0,from <command-line>:0: /usr/include/host_config.h:82:2: error: #error -- unsupported GNU version! gcc 4.7 and up are not supported! CMake Error at (message): Error generating /home/me/Desktop/opencv-.4.6.1/build/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./ make[2]: * [modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./] Error 1 make[1]: [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 make: ** [all] Error 2

The toolkit and cuda was installed using a ppa and it is working well with the samples.

Here is the compilers version of the box.

g++ --version g++ (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3

gcc --version gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3

nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2012 NVIDIA Corporation Built on Fri_Sep_21_17:28:58_PDT_2012 Cuda compilation tools, release 5.0, V0.2.1221

uname -a Linux 3.8.0-30-generic #44-Ubuntu SMP Thu Aug 22 20:52:24 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=13.04 DISTRIB_CODENAME=raring DISTRIB_DESCRIPTION="Ubuntu 13.04"

Pls, any hint will be appreciated.


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-10-01 07:46:51 -0500

Vladislav Vinogradov gravatar image

You can install the latest CUDA 5.5 Toolkit ( It supports gcc 4.7 and 4.8.

Or install gcc 4.6 and reconfigure CMake.

edit flag offensive delete link more


Thanks. I installed the CUDA 5.5 Toolkit and it compiled with out problems. Because I have installed gcc 4.6, I tried to use the flags with CMake but I got an error. Would you mind to post the flags to compile with gcc 4.6 . Thanks

pachamama gravatar imagepachamama ( 2013-10-01 15:03:58 -0500 )edit

Question Tools


Asked: 2013-10-01 07:21:48 -0500

Seen: 3,440 times

Last updated: Oct 01 '13