[FASTCGI] Help Building a C application with FastCGI (and lighttpd)

kaustubh kaustubh000 at gmail.com
Tue Mar 9 13:27:01 EST 2010

Aloha Developers !!
I am a fastCGI newbie stuck on a problem for 3 days now. Its high time I ask
for expert advice.
Here goes:-

Platform details:
Operating System: Ubuntu 8.04 Hardy Heron (I know this is not the latest
distribution, I have to use 8.04 due to some other restrictions)
FCGI kit version : fcgi-2.4.0

Goal: To setup the Lighttpd Web server with FastCGI and C application
support to serve dynamic content (final target for the web server: an
embedded device)

Steps Taken / Succeeded : Installing Lighttpd and configuring FastCGI for
PHP support (runs perfectly with any content type)

To Do: replace PHP (very large footprint) with a FastCGI C application (good
for small memory devices).

The FastCGI documentation for C development suggests that the FastCGI
development kit be downloaded. It gives a makefile for all applications
present but no clear instructions how to make changes to the makefile for
any new C applications. I cannot make head or tail of the makefile so am
unable to modify it for my new application. (I tried and failed numerous

alternately: When I try and compile using gcc instead:
gcc -I/home/owner/fcgi-2.4.0/libfcgi/ hello.c -o hello lfcgi
I get : lfcgi: No such file or directory

If i do gcc -I/home/owner/fcgi-2.4.0/libfcgi/ hello.c -o hello (same result
for gcc hello.c -o hello )
I get:
/tmp/ccmPV0on.o: In function `main':
hello.c:(.text+0x57): undefined reference to `FCGI_printf'
hello.c:(.text+0x5c): undefined reference to `FCGI_Accept'
collect2: ld returned 1 exit status

(By my understanding this is a linker problem)
The FastCGI document says that if configure and then make are executed in
the fcgi toolkit directory, a library file called libfcgi.a is supposed to
be created in $toolkit/libfcgi/ which is to be linked for building any new C
project applications.
This never happens, I cannot find this library file for the linker to find
even after configuring and making the toolkit No idea what is wrong here. (I
have copied all header files from the toolkit include folder to
/usr/include/ for the C preprocessor to find. )

There was a similar problem earlier found here:

It would be a huge help if you could help me figure out what is going on
with the building process. Any help with either how to use the fastCGI
development toolkit to build my C application OR with how to use gcc to
complie it would be greatly appreciated.

thanks and pardon my long post.


"All you need is ignorance and confidence and success is sure."  - Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.pins.net/mailman/private.cgi/fastcgi-developers/attachments/20100309/8e0dfebb/attachment.html>

More information about the FastCGI-developers mailing list