I'm having some trouble creating a vector in a shared memory segment
(compilation errors)
The code:
int main(){
//Allocator for the event list
typedef boost::interprocess::allocator
EventAllocator;
//the in memory vector of events
typedef boost::interprocess::vector EventList;
//is it already created?
EventList* pEventList = segment.find<EventList>(EVENTSEGMENT_NAME).first;
}
The error:
d:\boost_1_35_0\boost\preprocessor\iteration\detail\local.hpp(37): error
C2036: 'EventList *' : unknown size
And the trace:
DataHandle.cpp(53) : warning C4101: 'ex' : unreferenced local variable
d:\boost_1_35_0\boost\interprocess\mem_algo\rbtree_best_fit.hpp(353) : see reference to class template instantiation 'boost::interprocess::rbtree_best_fit' being compiled
d:\boost_1_35_0\boost\preprocessor\iteration\detail\local.hpp(37) : error C2036: 'EventList *' : unknown size
d:\boost_1_35_0\boost\preprocessor\iteration\detail\local.hpp(37) : see reference to class template instantiation 'boost::interprocess::vector' being compiled
with
[
T=int,
A=EventAllocator
]
d:\boost_1_35_0\boost\preprocessor\iteration\detail\local.hpp(37) : while compiling class-template member function 'void boost::interprocess::detail::Ctor1Arg::construct_n(void *,size_t,size_t &)'
with
[
T=EventList,
is_iterator=false,
P0=EventAllocator
]
d:\boost_1_35_0\boost\preprocessor\iteration\detail\local.hpp(37) : see reference to class template instantiation 'boost::interprocess::detail::Ctor1Arg' being compiled
with
[
T=EventList,
is_iterator=false,
P0=EventAllocator
]
DataHandle.cpp(51) : see reference to function template instantiation 'T *boost::interprocess::detail::named_proxy::operator ()<EventAllocator>(const P0 &) const' being compiled
with
[
T=EventList,
SegmentManager=boost::interprocess::segment_managerboost::interprocess::mutex_family,boost::interprocess::iset_index>,
is_iterator=false,
P0=EventAllocator
]