SharedMemory issues

I’m trying to run a program which can write to a shared memory location. The several examples I’ve found online are giving me trouble. Perhaps someone here can help.

The error I’m getting is:
unknown symbol: __deregister_frame_info
unknown symbol: __register_frame_info
Could not resolve all symbols

Is this because my compiler is out of date?

I’m ideally (with correct syntax, etc) running this code:

struct region { /* Defines “structure” of shared memory */
int len;
char buf[MAX_LEN];
};
struct region *rptr;
int fd;

/* Create shared memory object and set its size */

fd = shm_open("/myregion", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
if (fd == -1)
/* Handle error */;

if (ftruncate(fd, sizeof(struct region)) == -1)
/* Handle error */;

/* Map shared memory object */

rptr = mmap(NULL, sizeof(struct region),
PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
if (rptr == MAP_FAILED)
/* Handle error */;

/* Now we can refer to mapped region using fields of rptr;
for example, rptr->len */

How do you compile, link?

i run a make file from the directory which looks like this:

Client.qcp: Client.o
rm -f Client.qcp
$(LD) -o Client.qcp Client.o $(QMOTORLDFLAGS) -lgsl -gslcblas

LOCALCLEAN = rm -rf *.qcp

my include files are
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <limits.h>
#include <sys/mman.h>

I took off the -lgsl and -gslcblas and now I’m getting a “Memory fault (core dumped)” error at runtime.

Most probably a bug in your program…