---
title: "linux编译内核关于semaphore.h头文件的问题"
author: "koliy"
date: "2013-05-24T14:50:24Z"
tags: []
categories: ["编程语言"]
slug: "linux-semaphore-h"
draft: false
lastmod: "2013-05-24T14:50:24Z"
id: 1874670
url: "https://koliy.iteye.com/blog/1874670"
---

编译wifi的驱动，有时候会提示以下错误信息：
error: field 'sem_req' has incomplete type
error: field 'sem_async' has incomplete type
error: implicit declaration of function 'up'
error: implicit declaration of function 'down_interruptible'
。。。。

原因是linux内核升级之后，关于semaphore的头文件变了。修正这个错误很简单，只要在报错的文件中加入正确的头文件
#include <linux/semaphore.h>
不是 <asm/semaphore.h>了。