All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] linkage problem under 2.6.2.1
@ 2013-03-13 21:26 Tom Z
  2013-03-13 21:39 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Z @ 2013-03-13 21:26 UTC (permalink / raw)
  To: xenomai

Hi,

First I would like to sincerely thank all the people here that kindly 
helped me with my previous problems regarding Xenomai installation.
Now I got Xenomai 2.6.2.1 running on Ubuntu 12.04 (Linux-3.5.7) . I 
added 
"/usr/xenomai/bin:/usr/xenomai/lib:/usr/xenomai/include:/usr/local/lib" 
to my $PATH, and can run "xeno latency" and "xeno-test".
However, when I tried to compile this toy program found at 
http://www.cs.ru.nl/lab/xenomai/ , I got some linage problems as follows:
/tmp/ccwl2tpg.o: In function `main':
ex01.c:(.text+0x8a): undefined reference to `rt_print_auto_init'
ex01.c:(.text+0xa2): undefined reference to `rt_printf'
ex01.c:(.text+0xe3): undefined reference to `rt_task_create'
ex01.c:(.text+0xff): undefined reference to `rt_task_start'
collect2: ld returned 1 exit status

The above source code can be compiled & linked under Xenomai 2.4.3 
smoothly, and I understand that the rtdk library had been moved to 
libxenomai, so I changed the build flags accordingly. Below is what I 
used to build the above toy program:
gcc -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -D__XENO__ 
-lnative -L/usr/xenomai/lib -lxenomai -lpthread -lrt -lxenomai ex01.c -o 
ex01

On my system, running "xeno-config --skin=native --cflags" gets 
"-I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -D__XENO__",
and running "xeno-config --skin=native --ldflags" gets "-lnative 
-L/usr/xenomai/lib -lxenomai -lpthread -lrt".
Under "/usr/xenomai/lib", I can find libnative.[a|la|so], 
libxenomai.[a|la|so], and other libs.

I don't understand why there are still undefined reference to 
`rt_print_auto_init', etc. Did I miss something while building this program?

With many thanks,
Tom


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Xenomai] linkage problem under 2.6.2.1
  2013-03-13 21:26 [Xenomai] linkage problem under 2.6.2.1 Tom Z
@ 2013-03-13 21:39 ` Gilles Chanteperdrix
  2013-03-21 21:33   ` Tom Z
  0 siblings, 1 reply; 3+ messages in thread
From: Gilles Chanteperdrix @ 2013-03-13 21:39 UTC (permalink / raw)
  To: Tom Z; +Cc: xenomai

On 03/13/2013 10:26 PM, Tom Z wrote:

> Hi,


Hi,

> gcc -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -D__XENO__ 
> -lnative -L/usr/xenomai/lib -lxenomai -lpthread -lrt -lxenomai ex01.c -o 
> ex01


The link order seems wrong.

-- 
                                                                Gilles.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Xenomai] linkage problem under 2.6.2.1
  2013-03-13 21:39 ` Gilles Chanteperdrix
@ 2013-03-21 21:33   ` Tom Z
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Z @ 2013-03-21 21:33 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

Hi Gilles,

Thanks for your answer. You're right, the order was wrong. After a few 
trial&error, I changed to the following order, everything seems work well.
CFLAGS=$(shell $(XENOCONFIG) --skin=native --cflags)
LDFLAGS=$(shell $(XENOCONFIG) --skin=native --ldflags)
gcc $(CFLAGS) main.c $(LDFLAGS) -o main

Sincerely,
Tom

On 3/13/2013 4:39 PM, Gilles Chanteperdrix wrote:
> On 03/13/2013 10:26 PM, Tom Z wrote:
>
>> Hi,
>
> Hi,
>
>> gcc -I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT -D__XENO__
>> -lnative -L/usr/xenomai/lib -lxenomai -lpthread -lrt -lxenomai ex01.c -o
>> ex01
>
> The link order seems wrong.
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-21 21:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-13 21:26 [Xenomai] linkage problem under 2.6.2.1 Tom Z
2013-03-13 21:39 ` Gilles Chanteperdrix
2013-03-21 21:33   ` Tom Z

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.