【VS2013】error C2059: 語法錯誤:“::” error C2589: “(”:“::”右邊的非法標記
阿新 • • 發佈:2019-02-20
1.error:
錯誤 6 error C2059: 語法錯誤:“::” e:\anzhuang\opencv\build\include\opencv2\flann\lsh_table.h 266 1 number_detection
錯誤 5 error C2589: “(”:“::”右邊的非法標記 e:\anzhuang\opencv\build\include\opencv2\flann\lsh_table.h 266 1 number_detection
2.reason:
標頭檔案加入#include <Windows.h>後出現的錯誤
因為系統函式與pcl中的max函式衝突導致的
3.solution:
const size_t key_size_upper_bound = std::min(sizeof(BucketKey) * CHAR_BIT + 1, sizeof(size_t) * CHAR_BIT);
修改:增加括號
const size_t key_size_upper_bound = (std::min)(sizeof(BucketKey) * CHAR_BIT + 1, sizeof(size_t) * CHAR_BIT);