关于nominmax

关键字:PCL,pointcloud library,MFC,nominmax,afxcontrolbars,std,min,max

pcl中使用了std::min,std::max,但visualstudio中也有min/max的宏定义,两者相互冲突

解决办法:

1,对项目定义宏 NOMINMAX,取消min,max宏

如果不成功,比如使用了mfc afxcontrolbars

https://connect.microsoft.com/VisualStudio/feedback/details/622942/include-afxcontrolbars-h-is-not-compatible-with-define-nominmax

则使用下面的办法

2,只在pcl部分取消min max

#if defined (WIN32)

#undef max
#undef min
#endif

#include <pcl/io/pcd_io.h>

原文地址:https://www.cnblogs.com/kevinzhwl/p/3688713.html