There are several hard parts to putting objects in shared memory. They all have to do with pointers. You can't use any pointers, even within the shared memory segment, because it may be loaded in different spots in different processes. You have to be very sure that the objects contained don't malloc any space, since that space will be on the heap and not in shared memory, and the bad pointer can do bad things to other procs. They can't have virtual functions, because the virtual function tables may be in different spots in the local process memory.
For example, putting a string in the object is bad, because that allocates memory for the string.
I've seen people work around most of these, but it is painful. Using indexes instead of pointers can help.
Add to this the other problems. You'll have to learn to use mutexes/futexes between process to avoid race conditions.