A header file generally contains just enough so that your code will compile. Definitions of structures and classes that you might use, and the prototypes of functions. This is enough for your compiler to do its job, effectively leaving big gaps with notes on saying "here, go and run this library function which I promise you can find in a library that we're about to link to".
A header file is text and gets inserted into your code, and compiled. The library is the already compiled code. You
include header files in your code at
compile time; you
link to static libraries at link time and dynamic libraries at run time.
So, with this knowledge, it becomes clear that the pragma thing is meant to cause your linker to link to the right libraries.
There are two ways of linking to the right libraries. The first way is to tell your linker which libraries to link to. How do you know which libraries to link to? The library documentation tells you. How do you actually tell the linker? In your IDE, by putting the right library path name in the library path name box and the right library names in the library name box. How do you know the right path name? You installed the library yourself, so you ought to know where you put it.
The pragma method is a windows IDE thing, as far as I know, and it's meant to provide the exact same information to the linker as the other way. I've no experience of using the pragma to link against the libraries.
I am using OpenCV 2.2 and it says 2.1 Is there commands for OpenCV 2.2? |
Yes there are. Find the path and names of the libraries in version 2.2 and put those in instead.