|
Boost Users : |
From: Eugen Stoianovici (eugen.stoianovici_at_[hidden])
Date: 2008-07-15 14:36:23
I'm sorry, as always the problem was between keyboard and chair.
I forgot to include boost/interprocess/containers/vector.hpp but there
was a include <vector> somewhere and the compiler got confused
Thanks for your reply,
Eugen
Ion Gaztañaga wrote:
> Eugen Stoianovici wrote:
>> I'm having some trouble creating a vector in a shared memory segment
>> (compilation errors)
>>
>> The code:
>>
>> [...]
>
> This compiles fine in Visual 2003 and should not be problems with
> other compilers. Which compiler/version are you using?
>
> #include <boost/interprocess/containers/vector.hpp>
> #include <boost/interprocess/allocators/allocator.hpp>
> #include <boost/interprocess/managed_shared_memory.hpp>
>
> int main(){
> //Allocator for the event list
> typedef boost::interprocess::allocator
> <int,boost::interprocess::managed_shared_memory::segment_manager>
> EventAllocator;
>
> //the in memory vector of events
> typedef boost::interprocess::vector<int, EventAllocator> EventList;
>
> boost::interprocess::managed_shared_memory
> segment(boost::interprocess::open_only, "asdf");
> //is it already created?
> EventList* pEventList =
> segment.find<EventList>("EVENTSEGMENT_NAME").first;
>
> }
>
>
> Regards,
>
> Ion
>
>
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net