2

I am trying to install the driver for a serial device, and when I run the installation executable I get this error:

cc -DLINUX -c -DMODVERSIONS -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -m64 -mcmodel=kernel -I/usr/src/linux-3.8.0-27-generic/include -I/usr/src/linux-2.4/include -I/usr/src/linux/include -D__SMP__ npreal2.c
npreal2.c:40:31: **fatal error: linux/modversions.h: No such file or directory**
compilation terminated.

I don't find any solutions to this after searching the forums. I noticed that there is a modversions.h in the /usr/src/linux-3.8.0-27-generic/include/config , but not in the linux folder.

Please help!

yulian
  • 1,601
  • 3
  • 21
  • 49
Ann
  • 693
  • 3
  • 12
  • 17
  • Maybe you can make a soft link in the linux folder to the actual file? I am not sure how safe this is though. – gravitas Aug 15 '13 at 19:57
  • @RSinghS I did try using a soft link, as a result, I bypassed the first errors. Now I get LOTS of errors from other header files ... – Ann Aug 15 '13 at 22:37
  • you can check if the linux folder itself is a symlink with ls -al if it is not rename the folder with mv linux linux.bak then make a symlink like this ln -s /usr/src/linux-3.8.0-27-generic /usr/src/linux – syss Sep 16 '14 at 12:55

3 Answers3

1

Try passing -I /usr/src/linux-3.8.0-27-generic/include/config as an argument to make?

or

Check if the header is a part of a certain package and update the package.

gravitas
  • 703
  • 4
  • 16
0

You can compile modversions on your system by navigating to the linux directory (usually usr/src/linux). Inside the linux source directory, there should be a file called Rules.make. Inside this make file are build commands for making modversions.h. You can make it by running:

 make update-modverfile

Now, while this will make the modversions.h library, if you compile it with a newer compiler than the libraries that this file relies on, many times you will get an error when trying to run a program that uses this header. This then turns into a nightmare.

KrisSodroski
  • 2,796
  • 3
  • 24
  • 39
  • 1
    I don't find this file Rules.make, and when I run the command I get Configuration file ".config" not found! What else could I do? – Ann Aug 15 '13 at 20:37
0

Another method, I tried it successfully with Xubuntu 13.10:

  1. Open /etc/default/grub

  2. Add this Line and save it.

    GRUB_CMDLINE_LINUX="CONFIG_MODVERSIONS=true"
    
  3. reboot

    (no, sudo update-grub,ok)
    
  4. open a terminal window, enjoy.

    locate modversions.h
    

    (Please don't forget modversion'S')

Flexo
  • 87,323
  • 22
  • 191
  • 272