Taken from this answer (why don’t you google your question before asking?):
The SIFT and SURF code was moved in OpenCV v2.4 to a new module called
nonfree
. Make sure you are linking (DLL in Windlows) to it. In linux this library is called libopencv_nonfree.so
.