I had compiled OpenCV and when I linked my application with OpenCV libraries, I got this error:
undefined reference to `Imf_2_2::globalThreadCount()'
The Imf in the symbol above seems to be from the IlmImf library that is used to read and write OpenEXR images. Since I had no need for OpenEXR, I recompiled OpenCV with the setting
WITH_OPENEXR=OFF. Linking with the resulting OpenCV libraries worked fine.