Windows: Crash on knnMatch function call

I’ve created a customised cmake library for opencv on windows. I’ve included flann, features2d, calib3d modules during build & i’ve checked that corresponding module flags are enabled in opencv_modules.hpp.

In my source file, I’ve included following headers:
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/video.hpp>
#include <opencv2/features2d.hpp>
#include “opencv2/calib3d.hpp”
#include <opencv2/flann.hpp>

Then, knnMatch crashes at runtime. Could you please suggest what is missing here?

Sorry, please ignore this post. I had provided invalid input, which i couldn’t trace for couple of days.

I don’t know how somebody can help you without any source code and error message