[Rtai] shared memory: collect2: ld returned 1 exit status
Ivo Daniel Alves
1960576 at isep.ipp.pt
Tue Jan 12 18:26:26 CET 2010
Hi,
I'm trying to compile a example of RTAi shared memory.
I've no problem compiling the module but I'm having problem compiling
the user-space application.
*User-space application:*
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
#include <rtai_shm.h>
#include "parameters.h"
static int end;
static void endme(int dummy) { end=1; }
int main (void)
{
struct data_str *data;
signal(SIGINT, endme);
data = rtai_malloc (nam2num(SHMNAM),1);
while (!end) {
printf("Counter: %d Sine: %f Cosine: %f \n", data->indx_counter,
data->sin_value, data->cos_value);
}
rtai_free (nam2num(SHMNAM), &data);
return 0;
}
*
Shell output:*
gcc -I/usr/realtime/include -I/usr/include/ -o scope scope.c
/tmp/ccmlZfZw.o: In function `main':
scope.c:(.text+0x2ee): undefined reference to `nam2num'
scope.c:(.text+0x316): undefined reference to `_rt_shm_alloc'
scope.c:(.text+0x35b): undefined reference to `nam2num'
scope.c:(.text+0x363): undefined reference to `rt_shm_free'
collect2: ld returned 1 exit status
make: *** [default] Error 1
Thanks in advance and best regards,
Ivo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.rtai.org/pipermail/rtai/attachments/20100112/33d3da0f/attachment.htm>
More information about the Rtai
mailing list