我在从现有基于Makfile的项目导入的Eclipse项目中有以下C ++代码:
#ifndef LAZY_EVAL_FUNCTOR_
#define LAZY_EVAL_FUNCTOR_
#include <vector>
#include <stdlib.h>
namespace libtensor {
//Forward declaration
template<size_t N,typename T>
class labeled_sparse_btensor;
typedef std::vector<size_t> block_list;
//Used to erase other size parameters from contract_eval_functor
template<size_t N,typename T=double>
class lazy_eval_functor {
public:
virtual void operator()(labeled_sparse_btensor<N,T>& dest) const = 0;
//For direct tensors
virtual void operator()(labeled_sparse_btensor<N,T>& dest,std::vector< block_list >& output_block_lists) const = 0;
virtual ~lazy_eval_functor() {};
};
} // namespace libtensor
#endif /* LAZY_EVAL_FUNCTOR_ */
尽管包含已正确解析,但我仍然会在std :: vector出现的两行中出错:
Symbol 'vector' could not be resolved.
我已经添加了定义std :: vector的include路径:
我的操作系统是Mac OS X 10.6,我的gcc版本是gcc 4.2.1
请告知解决此问题的方法。
编辑:它似乎为其他标准成员执行此操作,例如std :: map。标头没有“未解决的包含”错误,但它找不到相应的类。