我正在尝试编译this program而我无法在线查找以下文件:
#include <libs/date_time/src/posix_time/posix_time_types.cpp>
#include <libs/date_time/src/gregorian/date_generators.cpp>
speed_test\speed_test.cpp|42|error: boost/date_time/posix_time/posix_time_types.cpp: No such file or directory|
speed_test\speed_test.cpp|43|error: boost/date_time/gregorian/date_generators.cpp: No such file or directory|
speed_test\MruCache.h||In member function 'void MruCache<key_type, value_type>::__insert_item(key_type, value_type)':|
speed_test\MruCache.h|70|error: 'ptrItr' was not declared in this scope|
speed_test\MruCache.h|71|error: expected primary-expression before ')' token|
speed_test\MruCache.h|71|error: expected ';' before 'mapOfListIteratorPtr'|
speed_test\MruCache.h|87|error: expected type-specifier|
speed_test\MruCache.h|87|error: expected ';'|
speed_test\MruCache.h||In member function 'value_type MruCache<key_type, value_type>::__find_item(key_type)':|
speed_test\MruCache.h|104|error: 'ptrItr' was not declared in this scope|
speed_test\MruCache.h|105|error: expected primary-expression before ')' token|
speed_test\MruCache.h|105|error: expected ';' before 'mapOfListIteratorPtr'|
C:\Dev-Cpp\project2\speed_test\MruCache.h||In member function 'virtual void MruCache<key_type, value_type>::__clear()':|
speed_test\MruCache.h|119|error: expected ';' before 'i'|
speed_test\MruCache.h|120|error: 'i' was not declared in this scope|
speed_test\MruCache.h|123|error: 'pItr' was not declared in this scope|
speed_test\MruCache.h|123|error: expected primary-expression before ')' token|
speed_test\MruCache.h|123|error: expected ';' before 'ptrItr'|
speed_test\mru.h|142|error: type/value mismatch at argument 1 in template parameter list for 'template<class _T1, class _T2> struct std::pair'|
speed_test\mru.h|142|error: expected a type, got 'boost::unordered_map::iterator'|
speed_test\mru.h|143|error: invalid type in declaration before '=' token|
speed_test\speed_test.cpp||In function 'int main(int, char**)':|
speed_test\speed_test.cpp|178|error: 'ihash' was not declared in this scope|
speed_test\speed_test.cpp|178|error: template argument 3 is invalid|
speed_test\speed_test.cpp|178|error: invalid type in declaration before ';' token|
speed_test\speed_test.cpp|186|error: request for member 'clear' in 'tiles1_2', which is of non-class type 'int'|
speed_test\speed_test.cpp|191|error: no match for 'operator[]' in 'tiles1_2[keys.std::vector<T, Allocator>::operator[] [with _Tp = tile_id, _Alloc = std::allocator<tile_id>](((unsigned int)i))]'|
speed_test\speed_test.cpp|202|error: no match for 'operator[]' in 'tiles1_2[keys.std::vector<T, Allocator>::operator[] [with _Tp = tile_id, _Alloc = std::allocator<tile_id>](((unsigned int)i))]'|
speed_test\speed_test.cpp|433|error: request for member 'find' in 'tiles1_2', which is of non-class type 'int'|
speed_test\speed_test.cpp|560|error: request for member 'clear' in 'tiles1_2', which is of non-class type 'int'|
speed_test\mru.h|241|instantiated from 'Value& mru::list<Key, Value>::operator[](const Key&) [with Key = tile_id, Value = boost::shared_ptr<test>]'|
speed_test\speed_test.cpp|340|instantiated from here|
speed_test\mru.h|143|error: dependent-name 'boost::unordered_map::value_type' is parsed as a non-type, but instantiation yields a type|
speed_test\mru.h|143|note: say 'typename boost::unordered_map::value_type' if a type is meant|
speed_test\mru.h|241|instantiated from 'Value& mru::list<Key, Value>::operator[](const Key&) [with Key = tile_id, Value = boost::shared_ptr<test>]'|
speed_test\speed_test.cpp|340|instantiated from here|
speed_test\mru.h|143|warning: unused variable 'p'|
||=== Build finished: 27 errors, 1 warnings ===|
答案 0 :(得分:1)
你似乎在#include指令中有一些错误,boost库通常包含在
中#include <boost/whatever.hpp>
或
#include <boost/module/header.hpp>
或者,如果未将boost库安装到包含路径,并且它存在于当前目录中:
#include "boost_1_46_1/boost/..."
文件名规则如上所述
阅读文档了解更多信息