
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