Skip to contentSkip to conversation

problem with trivial-periodic.c example

Xenomai-help Thomas Häberle 3 participants 3 messages Apr 4, 2008

lore
Share & tools
lore
#0 lore raw

Hello!

I am running Xenomai 2.3.5 on my MPC5200S on a STK52xx with a Linux 2.4.25-DENX kernel (cross-compiling to the target).

When I try to compile the "trivial-periodic.c" example with

Quoted 1 line
Quoted 1 line
Quoted 1 line
$ ppc_6xx-gcc SimpleTask.c -I $XENOINSTALL/include -L $XENOINSTALL/lib -o SimpleTask -Wall

I get the following:

Quoted 1 line
Quoted 1 line
Quoted 1 line

/tmp/ccwxJiOz.o(.text+0x30): In function `demo':
: undefined reference to `rt_task_set_periodic'
/tmp/ccwxJiOz.o(.text+0x34): In function `demo':
: undefined reference to `rt_timer_read'
/tmp/ccwxJiOz.o(.text+0x4c): In function `demo':
: undefined reference to `rt_task_wait_period'
/tmp/ccwxJiOz.o(.text+0x50): In function `demo':
: undefined reference to `rt_timer_read'
/tmp/ccwxJiOz.o(.text+0x160): In function `main':
: undefined reference to `rt_task_create'
/tmp/ccwxJiOz.o(.text+0x178): In function `main':
: undefined reference to `rt_task_start'
/tmp/ccwxJiOz.o(.text+0x188): In function `main':
: undefined reference to `rt_task_delete'
collect2: ld returned 1 exit status
<<<

Aren't the functions used in the example in the libraries in the "$XENOINSTALL/lib" directory? Or do I have to tell the compiler and/or linker about any of the Xenomai source paths to get this working?

Thanks & Greetings,
Thomas

#1 lore raw
Quoted 28 lines · Thomas Häberle

Hello!

I am running Xenomai 2.3.5 on my MPC5200S on a STK52xx with a Linux 2.4.25-DENX kernel (cross-compiling to the target).

When I try to compile the "trivial-periodic.c" example with

Quoted 1 line
Quoted 1 line
Quoted 1 line
$ ppc_6xx-gcc SimpleTask.c -I $XENOINSTALL/include -L 

$XENOINSTALL/lib -o SimpleTask -Wall

I get the following:

Quoted 1 line
Quoted 1 line
Quoted 1 line

/tmp/ccwxJiOz.o(.text+0x30): In function `demo':
: undefined reference to `rt_task_set_periodic'
/tmp/ccwxJiOz.o(.text+0x34): In function `demo':
: undefined reference to `rt_timer_read'
/tmp/ccwxJiOz.o(.text+0x4c): In function `demo':
: undefined reference to `rt_task_wait_period'
/tmp/ccwxJiOz.o(.text+0x50): In function `demo':
: undefined reference to `rt_timer_read'
/tmp/ccwxJiOz.o(.text+0x160): In function `main':
: undefined reference to `rt_task_create'
/tmp/ccwxJiOz.o(.text+0x178): In function `main':
: undefined reference to `rt_task_start'
/tmp/ccwxJiOz.o(.text+0x188): In function `main':
: undefined reference to `rt_task_delete'
collect2: ld returned 1 exit status
<<<

Quoted 4 lines

Aren't the functions used in the example in the libraries in the "$XENOINSTALL/lib" directory?
Or do I have to tell the compiler and/or linker about any of the Xenomai source paths to get this working?

Please use the Makefile in that directory to learn how to build it. You may need to define DESTDIR as well.

Wolfgang.

#2 lore raw
In reply to Thomas Häberle
Quoted 7 lines · Thomas Häberle

Hello!

I am running Xenomai 2.3.5 on my MPC5200S on a STK52xx with a Linux 2.4.25-DENX kernel (cross-compiling to the target).

When I try to compile the "trivial-periodic.c" example with

Quoted 1 line
Quoted 1 line
Quoted 1 line
$ ppc_6xx-gcc SimpleTask.c -I $XENOINSTALL/include -L 

$XENOINSTALL/lib -o SimpleTask -Wall

-lnative

Jan