error undefined reference while trying to compile
Dear,
I am using gcc to compile and make executable file with xenomai, but it getting error, so I want to ask how to get it compiled. I am using the code that I got from http://www.cs.ru.nl/lab/xenomai/exercises/ex01/Exercise-1.html
I am using the hello world example, and I write it in the file named helloworldRT.c this is how I make it compiled
[[email protected] Desktop]# gcc -c -I /usr/xenomai/include/ helloworldRT.c <it seems works>
[[email protected] Desktop]# gcc -o helloworldrt helloworldRT.o helloworldRT.o: In function `demo':
helloworldRT.c:(.text+0xe): undefined reference to rt_printf' helloworldRT.c:(.text+0x13): undefined reference to rt_task_self' helloworldRT.c:(.text+0x28): undefined reference to rt_task_inquire' helloworldRT.c:(.text+0x3e): undefined reference to rt_printf' helloworldRT.o: In function `main':
helloworldRT.c:(.text+0x55): undefined reference to rt_print_auto_init' helloworldRT.c:(.text+0x6d): undefined reference to rt_printf' helloworldRT.c:(.text+0xb6): undefined reference to rt_task_create' helloworldRT.c:(.text+0xd2): undefined reference to rt_task_start'
collect2: ld returned 1 exit status
<this is the error I got>
can somebody tell me how to compile it well? it seems I miss something in the way I compile. Can somebody tell me the right command?
Thanks
Quoted 6 lines · Ramon Rusli
Dear,
I am using gcc to compile and make executable file with xenomai, but it getting error, so I want to ask how to get it compiled. I am using the code that I got from
http://www.cs.ru.nl/lab/xenomai/exercises/ex01/Exercise-1.html
On the same page, see "Compiling a Xenomai program".
Signature · 1 line
Gilles.