Ask Your Question
0

with Cuda support undefined reference to cv::imread

asked 2019-08-30 20:28:26 -0500

shivsd gravatar image

Hi,

I have built Opencv3.4.5 with cuda support and below is the cmake command and after compiling opencv 3.4.5 and installing it i get following error while testing it. Please can you correct me if there is anything wrong in cmake command. cuda10.0 installed on GTX 1080, OS- ubuntu.

g++ -o test test.cpp /tmp/ccK24DIr.o: In function main': test.cpp:(.text+0xfb): undefined reference to cv::imread(cv::String const&, int)'

cmake command: cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -D WITH_CUDA=ON -D WITH_TBB=ON -D ENABLE_FAST_MATH=1 -D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1 -D PYTHON_EXECUTABLE=~/.virtualenvs/cv/bin/python -D WITH_QT=OFF -D BUILD_EXAMPLES=OFF -D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF -D CUDA_NVCC_FLAGS=--expt-relaxed-constexpr -D WITH_LIBV4L=ON -D WITH_V4L=ON ..

thanks in advance

edit retag flag offensive close merge delete

Comments

your cmake cmdline look like the one used to build the opencv libs, not your program . please show us the latter instead.

berak gravatar imageberak ( 2019-08-31 03:11:21 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-08-31 12:44:42 -0500

shivsd gravatar image

updated 2019-08-31 12:58:24 -0500

First i'm using cmake command to build opencv on my machine (build and install) And testing if my install is correct or wrong with this test.cpp by invoking opencv apis cv::imread. Anyways i got it. I forgot to link the libraries.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-08-30 20:28:26 -0500

Seen: 28 times

Last updated: Aug 30