以这个match函数为例(假设match函数定义在match.cpp文件中),主函数main.cpp文件调用它的时候include它的头文件match.h,而match.h中要include能识别match.cpp及match.h文件中所有用到的东西,如:Mat(至少要include cv.h 和using namespace cv),match.cpp就只用include match.h就可以了。
多个cpp文件间的函数调用
最新推荐文章于 2024-04-15 03:15:24 发布
以这个match函数为例(假设match函数定义在match.cpp文件中),主函数main.cpp文件调用它的时候include它的头文件match.h,而match.h中要include能识别match.cpp及match.h文件中所有用到的东西,如:Mat(至少要include cv.h 和using namespace cv),match.cpp就只用include match.h就可以了。