# including certain header files in the old C source (page.h et al.) on Ubuntu

I am new to GNU / Linux (Lubuntu 11.10) and have been trying to compile some C source code from the Linux programming book since 2001. I am a little confused by including header files in GNU / Linux.

Program "simplefb.c" from the book Programming Linux-Games by John R. Hall et al. (2001). I jumped right into the chapter on console programming using the framebuffer, but immediately hit that immediate latch. Just wanted to make some simple games without a GUI (and non-'text) in C on Linux for fun ...

The problem seems to be related to several #inclusions in the header files:

#include <asm/page.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <linux/fb.h>

Trying the code in the book:

cc the_file.c
gives a
fatal error: asm / page.h: no such file or directory compilation completed.

And indeed, it seems that these files live somewhere else (now?), So I first tried fixing only the first #include:

#include </usr/src/linux-headers-3.0.0-17-generic/include/asm-generic/page.h>    

I chose this particular header folder (in / usr / src /) there are several because
uname -r
3.0.0-17 is generic

With modified #include, I get a compilation error:

In the file included in the_file.c / usr / src / linux -headers-3.0.0-17-generic / include / asm-generic / page.h: 96: 38: fatal error: asm-
generic / memory_model.h : No such file or directory
compilation completed.

.h, include asm-generic/memory_model.h( "", ) .

, ( asm-generic/bit , ), , ? ?

. .

+3
2

: Linux, .

/usr/src/linux * .

/usr/include/* "" .

"".

, SDL OpenGL:

:

  • , fbdev ( ). Linux.

  • :

    sudo apt-get xserver-xorg-video-fbdev

  • , : apt-get .

', .. PSM

PS:

, " Linux-" SDL.

+3

-I gcc .

gcc ... -I /usr/src/.../include ...
0

All Articles