今天在用VC2008 对 我的 “Tree_Recognition” project 进行编译时,老是发现 在头文件segment .h 中定义的一个 'superSegment' 类无法识别,
在line 567 : superSegment seg;
总是说,
“h:\myprogramimg\tree_recognition\tree_recognition.cpp(567) : error C2065: 'superSegment' : undeclared identifier”
即使我 1、把 “segment .h ” 加到 "Tree_Recognition.cpp“ 中,
2、并且把 “segment .h ” 也加到project 中,
还是无法识别,网上找了很久 都没有找到合适的答案。
3、索性在 project 的 properties 中在C/C++ --------General ——— Additional Include Directories 中再 加上 segment .h 所在的目录:“../superpixel/ ”
这下,编译通过。
怎么是这里出了问题呢? 没有想通,一般来说(以前的项目验证过可行)只需要1 和 2 这两步就OK,但这次却非要 第 3 步。