2

I'm trying to compile this program and I'm having trouble finding the following files online:

#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 ===| 

1 Answer 1

1

You seem to have some mistake in the #include directive, boost libraries are usually included as

#include <boost/whatever.hpp> 

or

#include <boost/module/header.hpp> 

Or if the boost libraries were not installed to your include paths and it is present in the current directory:

#include "boost_1_46_1/boost/..." 

Rules for the filename are as said above

Read the docs for more info

Sign up to request clarification or add additional context in comments.

8 Comments

No... I literally searched for those files and I don't have them on my harddrive.
@lost_with_coding Now that's really weird. A dumb question, but I'm compelled to ask, are you sure you have installed boost at the first place?! And not some derivative of the same? DateTime is present in default boost installations and it is a header-only library.
yes I have the date_time folder with the header files but no .cpp file. Its weird. I did find the header files posix_time_types.h date_generators.h
@lost_with_coding : Why would you try to #include .cpp files anyway? Just build Boost.DateTime and include its headers normally.
@lost_with_coding, ildjam is right, you are supposed to use .hpp to include the headers and not those .cpp files (if they exist). .cpp files exist only for some of the libraries, and I don't think datetime is one of them. Remember, most of the boost libraries are header-only.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.