error: implicit declaration of function ‘rt_dev_socket’
1
vote
0
answers
986
views
**The developer says: http://comments.gmane.org/gmane.linux.real-time.rtnet.user/2546**
> > > Now how can I tell the Makefile to look for headers in
> > /usr/local/rtnet/include respectively how could I set my CFLAGS?
>
> EXTRA_CFLAGS := -I ...
>
> > Sorry for that not really RTnet dependent question, but I couldn't find
> > a Makefile-howto covering this question.
>
> Maybe this helps, though it a bit more complicated due to serving 2.4
> and 2.6 kernels:
**So, I took the makefile from here: http://svn.gna.org/viewcvs/xenomai/trunk/examples/rtdm/driver-api/
and added
-I /usr/local/rtnet/include
corresponding to **EXTRA_CFLAGS****
###### CONFIGURATION ######
### List of applications to be build
APPLICATIONS = hello
### Note: to override the search path for the xeno-config script, use "make XENO=..."
### List of modules to be build
MODULES = hello
### Note: to override the kernel source path, use "make KSRC=..."
###### USER SPACE BUILD (no change required normally) ######
ifeq ($(KERNELRELEASE),)
ifneq ($(APPLICATIONS),)
### Default Xenomai installation path
XENO ?= /usr/xenomai
XENOCONFIG=$(shell PATH=$(XENO):$(XENO)/bin:$(PATH) which xeno-config 2>/dev/null)
### Sanity check
ifeq ($(XENOCONFIG),)
all::
@echo ">>> Invoke make like this: \"make XENO=/path/to/xeno-config\"
#include
#include
#include
#include
#include
#include
RT_TASK demo_task;
void demo(void *arg)
{
RT_TASK *curtask;
RT_TASK_INFO curtaskinfo;
printf("Hello World!\n");
curtask=rt_task_self();
rt_task_inquire(curtask,&curtaskinfo);
printf("Task name : %s \n", curtaskinfo.name);
********int sockfd = rt_dev_socket(AF_INET, SOCK_DGRAM, 0);********
}
int main(int argc, char* argv[])
{
char str ;
rt_print_auto_init(1);
mlockall(MCL_CURRENT|MCL_FUTURE);
printf("start task\n");
sprintf(str,"hello");
rt_task_create(&demo_task, str, 0, 50, 0);
rt_task_start(&demo_task, &demo, 0);
}
Asked by Aquarius_Girl
(1275 rep)
Jun 25, 2012, 06:16 AM
Last activity: Jun 25, 2012, 06:21 AM
Last activity: Jun 25, 2012, 06:21 AM