LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux header files missing and v4l files unable to compile (http://www.linuxquestions.org/questions/linux-newbie-8/linux-header-files-missing-and-v4l-files-unable-to-compile-902809/)

szutshi 09-13-2011 12:38 PM

Linux header files missing and v4l files unable to compile
 
Hello here is some background info:
Ubuntu 11.04?
Cameras:
Logitech HD PRO WEBCAM C910
Logitech Webcam C905

I am working on trying to implement webcam control using the v4l library and c. I download the example file capture.c, the most luck ive had is the light comes on and all i get is a 100 '.' s in the terminal. Ive seen many threads on this website regarding this but most of the examples dont help me. SDL cam package gave me the error i see all the time similar to this:

vivi.c:15:26: fatal error: linux/module.h: No such file or directory
compilation terminated.

or others like SDL/SDL.h, or linux/videodev.h. its always something or the other, the headers just dont seem to work with the directory structure, they are all in linux-headers-2.x.x... or w/e

All i want to do is use c code to display my webcam. OpenCV apparently isnt compatible with both my camera's but i didnt want a middle system between my camera and its instructions anyways. Some help on how to take the frames in the buffer and take them and display them would be great. Even if i can just get them as ppms. Every different example i find always has some compilation error due to the directory structure and the header files not existing in their specified file paths.

Please help!

jdkaye 09-13-2011 12:52 PM

Hi and Welcome to LQ!
I'm not quite sure what your problem is. Have you already downloaded your kernel header files? If not you can download the header files for your kernel exactly the same way you download any other package.
ciao,
jdk

szutshi 09-13-2011 01:12 PM

Yes i have downloaded everything possible i believe.

If there is a command i can try to cross check or try and download again that would be great.

i am very very new to linux and have been thrown into a project so cross checking isn't easy :-(

knudfl 09-13-2011 02:08 PM

Terminal :

sudo apt-get install linux-headers libsdl1.2-dev

The on-line search
http://packages.ubuntu.com/search?su...headers-2.6.38
http://packages.ubuntu.com/search?su...s=linux-source
http://packages.ubuntu.com/search?su...=libsdl1.2-dev
http://packages.ubuntu.com/search?su...nux%2Fmodule.h

Please also use the "Search" in Synaptic.

About linux/module.h : You will have to point to e.g.
/usr/src/linux-headers-2.6.38-8-generic/include/

.

lystor 09-13-2011 02:09 PM

Quote:

Originally Posted by szutshi (Post 4470715)
vivi.c:15:26: fatal error: linux/module.h: No such file or directory
compilation terminated.

Hi
Try to install linux-headers deb:
Code:

# sudo apt-get install linux-headers-$(uname -r)

jdkaye 09-13-2011 03:00 PM

Quote:

Originally Posted by szutshi (Post 4470735)
Yes i have downloaded everything possible i believe.

No human has ever done that before. :)

Quote:

If there is a command i can try to cross check or try and download again that would be great.

i am very very new to linux and have been thrown into a project so cross checking isn't easy :-(
Knudfl and lystor have given you commands for downloading the headers. If you want to check (I don't know what cross checking means) if you have already downloaded the headers try this command:
Code:

aptitude search linux-headers
If you find the package with your kernel on it with an "i" at the beginning of the line this means that you have installed the headers. Here's an example taken from my system:
Code:

p  linux-headers-3.0.0-1-amd64                - Header files for Linux 3.0.0-1-amd64               
p  linux-headers-3.0.0-1-common              - Common header files for Linux 3.0.0-1               
p  linux-headers-3.0.0-1-common-rt            - Common header files for Linux 3.0.0-1-rt           
p  linux-headers-3.0.0-1-rt-amd64            - Header files for Linux 3.0.0-1-rt-amd64             
i A linux-headers-3.0.0-4.dmz.2-liquorix-amd64 - Header files for Linux 3.0.0-4.dmz.2-liquorix-amd64 
p  linux-headers-amd64                        - Header files for Linux amd64 configuration (meta-pack
i A linux-headers-liquorix-amd64              - Linux image for liquorix on 64-bit PCs

My current kernel is 3.0.0-4.dmz.2-liquorix-amd64 so you can see that I have installed the headers for my kernel. The "p" means the package is not installed.
ciao,
jdk


All times are GMT -5. The time now is 05:13 AM.