Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I 'm trying to compile a package in Ubuntu but getting error

"linux/autoconf.h: No such file or directory"

Now I see that the missing file is under /usr/src/linux-headers-2.6.38-11-generic/include/generated".

Where do I have to copy this file in order for the program to compile? I'm new to linux so please be specific if possible.

Update: Ok making progress. I think I have to copy the autoconf.h to a default location where the Linux kernel can find it.

I'm using Ubuntu 11.04. This is how my /usr/src folder looks like:

linux-headers-2.6.38-11-generic     
linux-headers-2.6.38-generic    
linux-headers-2.6.38-11
linux-headers-2.6.38-8
nvidia-current-270.41.06

Anyone know where I should copy the autoconf.h file?

Thanks in advance.

share|improve this question
    
You might have better luck asking in Super User. However, this is programming related so I'm not going to downvote it. –  Michael Oct 7 '11 at 1:21
    
a shot in the dark, have you actually autoconf installed? There is no general autoconf.h file, its always generated in a configure process. –  evildead Oct 7 '11 at 1:27
    
yes the autoconf.h file exists. I mention that on my question. The problem is that I'm new to Linux and I don't know where it should go in order for my program to find it. –  Marquinio Oct 7 '11 at 1:29
    
What are you trying to compile? Is it a kernel module? –  derobert Oct 7 '11 at 1:42
    
Its a USB driver –  Marquinio Oct 7 '11 at 1:46
add comment

migrated from stackoverflow.com Oct 10 '11 at 11:13

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 2 down vote accepted

You are trying to compile an external module. Modules need info on how the kernel was configured. However, this file has moved from linux/autoconf.h to generated/autoconf.h so the right thing to do is :

  • find the file including autoconf.h
  • replace this line with the following code :

I have to include something here for code formatting to work

#include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33)
#include <linux/autoconf.h>
#else
#include <generated/autoconf.h>
#endif
share|improve this answer
    
Thanks this actually fixed problem. I know this driver works in Fedora10 and was probably written for 32-bit. I'm now trying to compile it in 64-bit and getting weird compilation errors. I guess I would have to rewrite the driver for 64-bit? –  Marquinio Oct 11 '11 at 4:09
add comment

try copying it into /usr/src/linux-headers-2.6.38-11-generic/include/linux or /usr/src/linux-headers-2.6.38-generic/include/linux, depending on which kernel your currently using

share|improve this answer
1  
It would be better instead of copying, symlink. –  Balder Mar 16 '13 at 15:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.