Application compile problem when use RTnet

李冰 bingli at mail.sdu.edu.cn
Mon Mar 18 02:13:09 CET 2019


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!

 



More information about the Xenomai mailing list