Jetson TK1 / OpenCV4Tegra链接器错误

时间:2015-04-15 18:57:46

标签: c++ opencv cuda tegra

我有一个可以在我的机器上编译/运行的程序。我刚拿起一台Nvidia Jetson TK1尝试运行它。我按照指令herehere刷新了最新版本的linux4tegra,安装了cuda和opencv。每当我尝试运行make文件时,我都会收到链接器错误:

(.text+0x94): undefined reference to `cv::VideoCapture::VideoCapture(std::string const&)'
(.text+0xb2): undefined reference to `cv::VideoCapture::isOpened() const'
(.text+0xcc): undefined reference to `cv::VideoCapture::~VideoCapture()'
(.text+0x108): undefined reference to `cv::namedWindow(std::string const&, int)'
(.text+0x146): undefined reference to `vtable for cv::VideoCapture'
(.text+0x14a): undefined reference to `vtable for cv::VideoCapture'

我已经对一些cuda SO进行了编程,但我无法弄清楚这些来自何处。

我的makefile看起来像:

g++ `pkg-config --libs opencv` ...

包配置返回:

$ pkg-config --libs opencv
/usr/lib/libopencv_calib3d.so /usr/lib/libopencv_contrib.so /usr/lib/libopencv_core.so /usr/lib/libopencv_features2d.so /usr/lib/libopencv_flann.so /usr/lib/libopencv_gpu.so /usr/lib/libopencv_highgui.so /usr/lib/libopencv_imgproc.so /usr/lib/libopencv_legacy.so /usr/lib/libopencv_ml.so /usr/lib/libopencv_objdetect.so /usr/lib/libopencv_photo.so /usr/lib/libopencv_stitching.so /usr/lib/libopencv_superres.so /usr/lib/libopencv_ts.a /usr/lib/libopencv_video.so /usr/lib/libopencv_videostab.so /usr/lib/libopencv_esm_panorama.so /usr/lib/libopencv_facedetect.so /usr/lib/libopencv_imuvstab.so /usr/lib/libopencv_tegra.so /usr/lib/libopencv_vstab.so -lcufft -lnpps -lnppi -lnppc -lcudart -lrt -lpthread -lm -ldl  

有什么想法吗?我的初期虽然是标题/ SO不匹配,但由于这些都来自同一个包中的nvidia,我认为这不太可能。

1 个答案:

答案 0 :(得分:1)

原来我在make文件中的文件后需要pkg-config --libs opencv