Had similar problems on Ubuntu 13.10. Had to compile at end adding -lpthread g++...
FIxed by adding the following #include "/usr/include/opencv2/legacy/legacy.hpp"
FIxed by adding the following include "/usr/include/opencv2/legacy/legacy.hpp"
Note: $pkg-config --modversion opencv 2.4.5
tool_triangulaton.cpp compile error
Forgot to mention this is on Linux, Ubuntu 13.10
Get the same thing when trying to compile $make g++ -O3 -c pkg-config --cflags opencv...