Application compile problem when use RTnet

Ashwin Narayan ashwinnarayan1994 at gmail.com
Mon Mar 18 07:18:15 CET 2019


On Mon, Mar 18, 2019 at 9:13 AM 李冰 via Xenomai <xenomai at xenomai.org> wrote:

> Hi everyone:
>
>   I am new to RTnet. I am using xenomai + RTnet in Ubuntu,Xenomai version
> 3.0.5,  Linux kernal version 4.9.38. And the ethernet card is Intel e1000.
>
>   I am going to program use RTnet to communicate with another device called
> RTDS. And I can’t find any example in except demo in Xenomai 2. So I try to
> compile the demo code in Xenomai 2.But I got an error when I compile the
> demo code. The code in demo is as below:
>
>
>
> #include <alchemy/task.h>
>
> #include <rtdm/rtdm.h>
>
> #include <trank/rtdm/rtdm.h>
>
> // #include <rtdm/uapi/rtdm.h>   The original code in the example, but
> there
> is no rtdm.h file in uapi folder.
>
> #include <linux/net.h>   /* required for rt_task_wait_period() changes */
>
>
>
> When I compile the code, It throw an error :
>
> ```
>
> In file included from frag-ip.c:37:0:
>
> /usr/xenomai/include/trank/rtdm/rtdm.h:21:28: fatal error: rtdm/rtdm.h: No
> such file or directory
>
> compilation terminated.
>
> ```
>
> The error is from “/usr/xenomai/include/trank/rtdm/rtdm.h” , and I put the
> code below in rtdm.h
>
>
>
> #ifndef _XENOMAI_TRANK_RTDM_RTDM_H
>
> #define _XENOMAI_TRANK_RTDM_RTDM_H
>
> #include_next <rtdm/rtdm.h>              //Error is form this statement
>
>  #ifdef __cplusplus
>
> extern "C" {
>
> #endif
>
>
>
> I use the makefile as below:
>
>
>
> XENO_CONFIG := /usr/xenomai/bin/xeno-config
>
> CFLAGS := $(shell $(XENO_CONFIG) --posix --alchemy --cflags)
>
> LDFLAGS := $(shell $(XENO_CONFIG) --posix --alchemy --ldflags)
>
> CC := gcc
>
> EXECUTABLE := frag-ip
>
> all: $(EXECUTABLE)
>
> %: %.c
>
>         $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
>
>
>
> I am so confused, and I can’t sovle the problem , so if there some one
> understand where this problem is?
>
> Thanks for everyone who spend time to give me some help!
>
>
> Hi,

I think that you might have to include the "--rtdm" in xeno-config. I've
had some issues with compiling code when I don't put in that flag. However,
I am using the alchemy api so things may be different. But you can try and
see anyway.

Best,
-Ashwin


More information about the Xenomai mailing list