安装 opencv 时 libcudo.so 中出现未定义的引用错误

安装 opencv 时 libcudo.so 中出现未定义的引用错误

我正在使用这个[脚本][1]在我的 ubuntu 16.04 中安装 opencv。

sudo apt-get install -y unzip wget
wget https://github.com/opencv/opencv/archive/3.2.0.zip
unzip 3.2.0.zip
rm 3.2.0.zip
mv opencv-3.2.0 OpenCV
cd OpenCV
mkdir build
cd build
cmake -DWITH_QT=ON -DWITH_OPENGL=ON -DFORCE_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_XINE=ON -DBUILD_EXAMPLES=ON ..
make -j4
sudo make install
sudo ldconfig

但我遇到了这些 [错误][2](我已创建错误日志)。请帮助我解决这个问题。

[ 97%] Linking CXX executable ../../bin/gpu-example-driver_api_multi
samples/gpu/CMakeFiles/example_gpu_driver_api_multi.dir/build.make:124: recipe for target 'bin/gpu-example-driver_api_multi' failed
CMakeFiles/Makefile2:22721: recipe for target 'samples/gpu/CMakeFiles/example_gpu_driver_api_multi.dir/all' failed
Makefile:160: recipe for target 'all' failed

saurabh@saurabh-GL502VM:~/OpenCV/build$ sudo make 2>&1 > errors.txt
/usr/bin/ld: warning: libnvidia-fatbinaryloader.so.367.57, needed by /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so, not found (try using -rpath or -rpath-link)
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_shnum'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Get_FatBinary_From_Object'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Add_Cubin'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_section_contents'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_section_header'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `gpuInfoRunsOn'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_section_header'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf_end'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `stdGetThreadContext'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_named_section_header'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_shnum'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Delete'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Finish_Reading_Library'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `fatBinaryCtl'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_symbol_shndx'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_typed_section_header'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `gpucompRestoreLogLine'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_file_header'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Free_Fatbinary'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_string_at_offset'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_symbol_shndx'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `fatBinaryCtl_Compile'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `fatBinaryCtl_PickCandidate'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_file_header'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_string_at_offset'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Load_Host_Object'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Start'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Start_Reading_Library'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_typed_section_header'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Next_Library_Member'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `gpucompSetLogLine'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Finish'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_section_name'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf_is_64bit'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elfLink_Free_Host_Object'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_named_section_header'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf_size'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_symbol_name'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf32_section_name'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `fatBinaryCtl_Delete'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `fatBinaryCtl_Create'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcuda.so: undefined reference to `elf64_symbol_name'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/gpu-example-driver_api_multi] Error 1
make[1]: *** [samples/gpu/CMakeFiles/example_gpu_driver_api_multi.dir/all] Error 2
make: *** [all] Error 2

相关内容