Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22137

Add linux headers in gcc command

$
0
0

So I'm trying to include some headers in a c file on ubuntu16.04.

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>

#include "list.h"
#include "phypages.h"
#include "pagetable.h"

It has the error:

fatal error: list.h: No such file or directory

I found all linux header files are in the

/usr/src/linux-headers-4.4.0-164/include/linux

So I use -I to include

gcc XXX.c -o XXX -I/usr/src/linux-headers-4.4.0-164/include/linux

But then has the error

/usr/src/linux-headers-4.4.0-164/include/linux/stddef.h:4:31: fatal error: uapi/linux/stddef.h: No such file or directory

Can anyone help? Thank you!


Viewing all articles
Browse latest Browse all 22137

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>