I've been struggling with a simple hello-world style opencv application in c++, and while it compiles fine, it wouldn't link.
From what I've read,
http://answers.opencv.org/question/25708/undefined-symbols-cv_outputarray_outputarraystd__1vectorcvmat-std__1allocatorcvmat/
the problem seemed to be a difference between how OpenCV was originally built on the VM, and how my application is being built
(
The VM I'm using is
https://github.com/razius/ppy-opencv-vagrant (Ubuntu 14.04.5 / OpenCV 2.4.13))
https://github.com/dvreed77/vagrant-opencv
)
I WAS trying to build the application this way,
g++ -O2 `pkg-config --cflags --libs opencv` test.cpp -o test.out
but changing it to this, the linker suddenly builds fine:
g++ -O2 -o test.out test.cpp `pkg-config opencv --cflags --libs`
What is happening differently that makes it work?