I followed whatever is suggested at http://ubuntuforums.org/showthread.php?t=654153.
I had followed the commands that are given there. Recounting them here..
aptitude install qc-usb-sources
sudo m-a prepare
sudo m-a build qc-usb
dpkg -i qc-usb-modules-[your_version].deb
Now, firing up gqcam fails. In XTerm, it was exiting with message, device file not found. In /dev, the file that corresponds to the cam is /dev/video0. I did a ln -s video0 video and now gqcam show a vague resemblence if what lies in front of its eye.
Wow! never expected I’ll get this cam working on this beige machine. Remember, the cam is no less than seven years old. It worked OK under Windows. But after quitting Windows, I had almost given up hopes on getting this cam work.
Now, gotta learn how to use this cam under Pidgin or such applications..
here is what ‘lsusb’ says about this cam: “Bus 002 Device 002: ID 046d:0850 Logitech, Inc. QuickCam Web”
Until recently, pcc was only complaining that it couldn’t locate headers. I have only tried a plain one liner helloworld.c.
It complained about missing stdio.h. I pointed the location. Then it complained about a headers used by stdio missing. This went on for upto some four or five levels of headers within headers and at last, pcc would find errors with the headers themselves. Too bad I haven’t recorded those error messages before doing a ‘cvs-update’.
After the ‘cvs-update’, pcc now refuses to build.
Below is the output of the configure script.
santhi@debian:~/testing/pcc$ ./configure –prefix=/home/santhi/testing/pcc_install
checking whether make sets $(MAKE)… yes
checking for a BSD-compatible install… /usr/bin/install -c
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking target system type… i686-pc-linux-gnu
checking for gcc… gcc
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ANSI C… none needed
checking whether byte ordering is bigendian… no
checking for gcc… (cached) gcc
checking whether we are using the GNU C compiler… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for gcc option to accept ANSI C… (cached) none needed
checking for flex… flex
checking for yywrap in -lfl… yes
checking lex output file root… lex.yy
checking whether yytext is a pointer… yes
checking for bison… bison -y
checking for a C compiler for mkext… not cross compiling
checking for strip… yes
checking how to run the C preprocessor… gcc -E
checking for egrep… grep -E
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking for string.h… (cached) yes
checking alloca.h usability… yes
checking alloca.h presence… yes
checking for alloca.h… yes
checking for working alloca.h… yes
checking for alloca… yes
checking for mkstemp… yes
checking for strlcat… no
checking for strlcpy… no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating cc/Makefile
config.status: creating cc/cc/Makefile
config.status: creating cc/cpp/Makefile
config.status: creating cc/ccom/Makefile
config.status: creating f77/Makefile
config.status: creating f77/f77/Makefile
config.status: creating f77/fcom/Makefile
config.status: creating config.h
Target CPU is ……………….. i386
Target OS is ………………… linux
Compiler is called …………… ppc
Installing compiler into ……… /home/santhi/testing/pcc_install/bin
Installing pre-processor into …. /home/santhi/testing/pcc_install/libexec
Using assembler ………………
Using linker …………………
Using include path ……………
Using library path ……………
Configure finished. Do ‘make && make install’ to compile and install.
It shows two functions are missing. But that was not a problem before the ‘cvs-update’ and I don’t expect that to make a big fuss after the ‘cvs-update’ as well.
Running make says..
cd cc && make all
make: Entering directory `/home/santhi/testing/pcc/cc’
cd cc; make all -w
make: Entering directory `/home/santhi/testing/pcc/cc/cc’
gcc -I../../os/linux -I../../arch/i386 -Dmach_i386 -Dos_linux -g -O2 -DLIBEXECDIR=\”/home/santhi/testing/pcc_install/libexec\” -DINCLUDEDIR=\”/home/santhi/testing/pcc_install/include\” -c cc.c
cc.c:150: error: expected expression before ‘/’ token
cc.c:151: error: expected expression before ‘/’ token
cc.c:152: error: expected expression before ‘/’ token
cc.c:152: error: initializer element is not constant
cc.c:152: error: (near initialization for ‘endfiles’)
make: *** [cc.o] Error 1
make: Leaving directory `/home/santhi/testing/pcc/cc/cc’
make: *** [cc] Error 2
make: Leaving directory `/home/santhi/testing/pcc/cc’
make: *** [cc] Error 2
This error, when the code apparently compiles on NetBSD and OpenBSD systeems, presumably both systems use gcc.
I am left wondering what is wrong with this code. Contacting thee mailing list got a wiki page up in the pcc official site. They suggested that some header or lib path is wrongly set.
I searched for the error message over the Internet. Google could only find some 150 (give or take 10) hits of which only about a handful had the exact error message. Of them, one suggestion was, some build-essential packages are missing on the system.
configure script’s screen output shows nothing so badly missing. So, what am I staring at now? A correct C code for sure. A working gcc(4.2 that is available on Debian unstable). Some missing packages? What packages are missed so badly? The investigation continues..
Its been a long time since I last updated about my work on pcc. I contacted the Debian Developer who had filed an ITP for pcc. But he had told he was busy and will send some patches along with explanations to get pcc compile a ‘hello world’ program.
I was growing curious and had lot of time on hand to look around. So, I took the source rpms from the Downloads section.
Installed alien and rpm and made debs from them as described here.
But the rpm way looks like too much of work for now. So, I wrote a gdb command file with 100s of ‘s frame bt’ after setting args and breakpoints and running. Then I built the pcc from cvs and ran gdb with the command file. GDB promptly spewed out all the lines of code that were executed along with the requested information. But haven’t looked in the 1000s of lines of code that is traced by this command file yet. I hope to figure out the problem today before I fall asleep 😀
I use a Debian unstable installation on an old P4(1.3GHz) Compaq Presario 7000 series machine. Its specs are modest and kind of antique in today’s standards. So a natural choice for trying out things.
I do ‘aptitude update && aptitude full-upgrade’ once a month or so. I hope to do that more often soon. But not for now.
Here is what I did to build it on my machine:
* I downloaded the pcc CVS tree. (It is the same pcc that I had posted about just a few days back)
* Change to that directory.
* run ./configure.
* scroll up the buffer to see if any tool is missing.
* for all the missing tools, do ‘aptitude install package1 package2 …’ (I was missing flex so I did aptitude install flex flex-doc’).
* make install.
So far, I have only built it. I will post how to use it late this evening. I will hopefully find out how to make manpages from its nroff files and get a good idea over how to use it.
By the way, this is how I read manpages of pcc at this moment: ‘$ groff -Tascii -man ccom.1’ or ‘$ groff -Tascii -man cpp.1’ or ‘$ groff -Tascii -man pcc.1’.
I tried compiling a “Hello World” program with pcc. There were some include path files missing. Getting late now, I’ll try fixing those include paths and perhaps library paths as well tomorrow. 😉
No work done today. (shrug) Saturday :D. Anyway, subscribed to the mailing lists just a while back. For anything that I couldn’t fiddle with and fix, I’ll seek their help and who knows, I’ll soon end up either packaging pcc for Debian or send a few patches to the list.
I’m already looking at how to make the configure script more verbose so that people less careful like me don’t missout on the “No” of the script.
As of now, I’m not sure if my old Logitech Quickcam web would work on my computer. I have Debian unstable running. This is the only OS on the computer. The factory made CDs to install Windows Me(yuck!) have stopped working long back. So far, no luck in finding any drivers to get the webcam working.
Its been a long time I made it a point to jot down what I learn new on the IRC channels here. Here is what I learned from #debian today.
whenever building come package complains that some other packages are missing, best bet is to do “apt-get build-deb “.
“source file” works on bash as it works on C shell. But . also works the same way on bash. Why two things to do the same work? Well, I didn’t follow the nick to other channels where they might have asked the same question. So, I have no clue, and it remains as a thing to be figured out soon.
#hardware is the best channel to ask BIOS or any other hardware questions.
winding up this post.. still lingering on the channel..
My sister was pestering me to install Tally software on the computer. She wouldn’t listen to me when I say the downloaded package from Tally Solutions’ site wouldn’t install on our Debian Lenny system.