我正在关注这个问题:https://docs.opencv.org/3.2.0/d7/d9f/tutorial_linux_install.html由于我遇到的错误,我必须在cmake上设置几个参数...
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON -DWITH_VTK=ON ~/fuck/opencv ..
这是运行'make'时的错误:
[ 46%] Linking CXX executable ../../bin/opencv_test_viz
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFReadDirectory@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_CTX_use_certificate_chain_file@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_CTX_free@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_get_version@OPENSSL_1.0.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFIsTiled@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `CRYPTO_get_id_callback@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `BIO_int_ctrl@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_get_error@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_use_PrivateKey_file@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `X509_NAME_get_entry@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `ASN1_STRING_length@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_set_ex_data@OPENSSL_1.0.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFScanlineSize@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `X509_STORE_set_flags@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `BIO_new@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSLv23_method@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `X509_get_subject_name@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `ENGINE_load_private_key@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `X509_NAME_ENTRY_get_data@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `CRYPTO_set_id_callback@OPENSSL_1.0.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFClose@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_CTX_get_cert_store@OPENSSL_1.0.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFGetFieldDefaulted@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_check_private_key@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `ENGINE_by_id@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `CRYPTO_set_locking_callback@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `BIO_clear_flags@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_write@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `X509_free@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_free@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_ctrl@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_set_verify@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_CIPHER_get_bits@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_use_PrivateKey@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `sk_free@OPENSSL_1.0.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFSetWarningHandler@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `ENGINE_finish@OPENSSL_1.0.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `_TIFFmalloc@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `X509_get_ext_d2i@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_get_peer_certificate@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `CRYPTO_num_locks@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_get_current_compression@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `ENGINE_free@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `ASN1_STRING_data@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `OPENSSL_config@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `X509_STORE_load_locations@OPENSSL_1.0.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFDefaultStripSize@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_CIPHER_get_name@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `sk_num@OPENSSL_1.0.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFReadTile@LIBTIFF_4.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFWriteScanline@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_read@OPENSSL_1.0.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `_TIFFfree@LIBTIFF_4.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFGetField@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `BIO_set_flags@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `CRYPTO_get_locking_callback@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `sk_value@OPENSSL_1.0.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFClientOpen@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_CTX_new@OPENSSL_1.0.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFNumberOfDirectories@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `ERR_put_error@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `ERR_get_error@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `BIO_s_socket@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_new@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_load_error_strings@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_get_current_cipher@OPENSSL_1.0.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFOpen@LIBTIFF_4.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFReadRGBAImage@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_CTX_load_verify_locations@OPENSSL_1.0.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFSetField@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `ERR_clear_error@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `ENGINE_init@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_set_bio@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `ERR_reason_error_string@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_connect@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `X509_NAME_get_index_by_NID@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_CTX_ctrl@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_pending@OPENSSL_1.0.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_library_init@OPENSSL_1.0.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFSetErrorHandler@LIBTIFF_4.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFSetDirectory@LIBTIFF_4.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFReadScanline@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libpq.so.5: undefined reference to `SSL_shutdown@OPENSSL_1.0.0'
//usr/lib/libvtkIO.so.5.10: undefined reference to `TIFFNumberOfTiles@LIBTIFF_4.0'
collect2: error: ld returned 1 exit status
modules/viz/CMakeFiles/opencv_test_viz.dir/build.make:239: recipe for target 'bin/opencv_test_viz' failed
make[2]: *** [bin/opencv_test_viz] Error 1
CMakeFiles/Makefile2:4014: recipe for target 'modules/viz/CMakeFiles/opencv_test_viz.dir/all' failed
make[1]: *** [modules/viz/CMakeFiles/opencv_test_viz.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
系统信息:
__Hardware Information__
Machine : x86_64
CPU Name : skylake
CPU Features :
adx aes avx avx2 bmi bmi2 clflushopt cmov cx16 f16c fma fsgsbase lzcnt mmx movbe
pclmul popcnt prfchw rdrnd rdseed sgx sse sse2 sse3 sse4.1 sse4.2 ssse3 xsave
xsavec xsaveopt xsaves
__OS Information__
Platform : Linux-4.13.0-32-generic-x86_64-with-debian-stretch-sid
Release : 4.13.0-32-generic
System Name : Linux
Version : #35~16.04.1-Ubuntu SMP Thu Jan 25 10:13:43 UTC 2018
OS specific info : debianstretch/sid
glibc info : glibc 2.9
__Python Information__
Python Compiler : GCC 7.2.0
Python Implementation : CPython
Python Version : 3.6.3
Python Locale : en_IN ISO8859-1
__LLVM information__
LLVM version : 5.0.0
__CUDA Information__
Found 1 CUDA devices
id 0 b'GeForce 940MX' [SUPPORTED]
compute capability: 5.0
pci device id: 0
pci bus id: 1
Summary:
1/1 devices are supported
CUDA driver version : 9010
CUDA libraries:
Finding cublas
named libcublas.so.8.0.88
trying to open library... ok
Finding cusparse
named libcusparse.so.8.0.61
trying to open library... ok
Finding cufft
named libcufft.so.8.0.61
trying to open library... ok
Finding curand
named libcurand.so.8.0.61
trying to open library... ok
Finding nvvm
named libnvvm.so.3.1.0
trying to open library... ok
finding libdevice for compute_20... ok
finding libdevice for compute_30... ok
finding libdevice for compute_35... ok
finding libdevice for compute_50... ok
__Conda Information__
conda_build_version : 3.0.27
conda_env_version : 4.4.9
platform : linux-64
python_version : 3.6.3.final.0
root_writable : True
CUDA 9.1 OpenCV工作正常,直到我在我的系统上安装了CUDA工具包。
答案 0 :(得分:0)
好吧,我安装了CUDA 8.0并为OpenCV运行了不同的脚本:https://github.com/ap193uee/Install-Scripts/blob/master/opencv3.sh
解决了我的问题。