I recently built OpenCV 4.2.0 on my XNX and i am trying to use it in a CUDA-C++ file as shown below.
#include <cudnn.h>
#include <cassert>
#include <cstdlib>
#include <iostream>
#include <opencv2/opencv.hpp>
cv::Mat load_image(const char* image_path){
cv::Mat image = cv::imread(image_path);
image.convertTo(image, CV_32FC3);
cv::normalize(image, image, 0, 1, cv::NORM_MINMAX);
return image;
}
int main(void){
cudnnHandle_t cudnn;
cudnnCreate(&cudnn);
cv::Mat image = load_image("conure.jpg");
return 0;
}
However, when i try to compile with nvcc i get this
a bunch of undefined references to 'cv:: … ’
my path to opencv is
'/usr/include/opencv2'
and when i built OpenCV i included the flag
-DCUDNN_INCLUDE_DIR='/usr/include' \
anybody know whats wrong?, thanks.