使用Matlab mex nearest_neighbors.cpp注意事项
这几天尝试用Cmake+matlab+VS2015编译Flann库的matlab接口,最后在VS2015中build mex_nearest_neighbors时,一直出现“cmd.exe”已退出,值为-1,。查阅大量网上教程,一直没有解决。现在使用matlab直接mex nearest_neighbors.cpp,生成nearest_neighbors.mexw64,方法如下:
1 将src\cpp下的flann文件夹拷贝至src\matlab中
2修改nearest_neighbors.cpp文件
将#include <flann/flann.h>改成
#include “flann/flann.cpp”
3 同样修改flann\algorithms中的kmeans_index.h