From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <753266.83805.qm@domain.hid> Date: Wed, 23 Feb 2011 03:18:05 +0800 (SGT) From: Ramon Rusli MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1458569481-1298402285=:83805" Subject: [Xenomai-help] [ask] error undefined reference while trying to compile List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org Cc: Ramon Rusli --0-1458569481-1298402285=:83805 Content-Type: text/plain; charset=us-ascii 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 [root@domain.hid Desktop]# gcc -c -I /usr/xenomai/include/ helloworldRT.c [root@domain.hid 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 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 --0-1458569481-1298402285=:83805 Content-Type: text/html; charset=us-ascii
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
[root@domain.hid Desktop]# gcc -c -I /usr/xenomai/include/ helloworldRT.c
<it seems works>
[root@domain.hid 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


--0-1458569481-1298402285=:83805--