2013年8月31日星期六

# About the program and how to find the pathcontains problems encountered

Recently came into contact with linux, because in the program to use msleep (), so adding a header file . But the program can not find this header file, then google to find an article about the program is how to find the header file of the article. http://blog.sina.com.cn/s/blog_4d3a41f40101dq82.html Then I re-engineering configuration wrote this sentence-I / usr/src/kernels/2.6.18-194.el5-x86_64/include This is my ; the directory, I use rhel5. But in the compiler that there is a
/ usr/src/kernels/2.6.18-194.el5-x86_64/include/linux/hardirq.h: 55:2: error: # error PREEMPT_ACTIVE is too low!
/ usr/src/kernels/2.6.18-194.el5-x86_64/include/linux/bitops.h: In function 'int get_bitmask_order (unsigned int)':
/ usr/src/kernels/2.6.18-194.el5-x86_64/include/linux/bitops.h: 15: error: 'fls' was not declared in this scope
other issues (not enumerate many problems). Why is there such a problem? When everyone in the included encountered such a problem?
------ Solution ---------------------------------------- ----
This is compile the application?
linux system calls and libraries are not defined msleep it c
compile the application using the kernel header files, error is inevitable
recommend using usleep or their own definition of a msleep
------ Solution ---------------------------- ----------------
others perhaps have been re-compile the kernel module or defined msleep a
------ For reference only ------ ---------------------------------
Well, I later switched usleep, multiplied by the default parameters 1000. So do not pack the kernel header files, and also is correct. But still wonder why the kernel header files can not use it? I look at the procedures are this package, and then use the inside of msleep, ah!

没有评论:

发表评论