Application compile problem when use RTnet
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)
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!
Quoted 80 lines · 李冰 via Xenomai
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 nortdm.hfile in uapi folder.#include <
linux/net.h> /* required forrt_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
__cplusplusextern "C" {
#endif
I use the makefile as below:
XENO_CONFIG:=/usr/xenomai/bin/xeno-configCFLAGS := $(shell $(XENO_CONFIG) --posix --alchemy --cflags)
LDFLAGS := $(shell $(XENO_CONFIG) --posix --alchemy --ldflags)
CC = gccEXECUTABLE := frag-ip
all: $(EXECUTABLE)
%: %.c
$(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
Quoted 7 lines
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