T4L / OpenCV linker errors

Hey Guys,

I just got a Jetson TK1. Flashed with the latest version, installed cuda and opencv4tegra. I have a program that compiles on other systems. It uses a make file that looks like this:

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

Package config appears to work correctly:

$ 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

Everything compiles just fine but I seem to be hitting a bunch of weird linker errors like:

undefined reference to `cv::VideoCapture::VideoCapture(std::string const&)`
undefined reference to `cv::VideoCapture::isOpened() const`
undefined reference to `cv::VideoCapture::~VideoCapture()`
undefined reference to `cv::namedWindow(std::string const&, int)`

Any ideas?

Fixed this by moving package-config to the end of my g++ command.