-   Programming (
-   -   gcc cannot find FastCGI libraries (

Woppe 01-06-2010 11:55 AM

gcc cannot find FastCGI libraries
I've been trying for days now to build my first FastCGI application using gcc.
This is the output:

$ gcc tiny-fcgi.c -L/usr/lib -llibfcgi
/usr/bin/ld: cannot find -llibfcgi
collect2: ld returned 1 exit status

I believe I wouldn't have to refer to the lib path, but I added the -L flag to be sure.
The directory /usr/lib includes (among others) these files:

$ ls /usr/lib/libfcgi*
/usr/lib/libfcgi.a    /usr/lib/      /usr/lib/
/usr/lib/libfcgi++.a  /usr/lib/    /usr/lib/
/usr/lib/    /usr/lib/
/usr/lib/  /usr/lib/

I have tried to follow these instructions. The files in the tar.gz archive provided by no longer corresponds to the instructions there, but I was still able to run the ./configure and make commands so I believe FastCGI is installed.

But why can not the library be properly linked to? Really hope you can help me out on this one!

rnesius 01-06-2010 12:15 PM

Try changing -llibfcgi to -lfcgi. Gcc/gld should expand -lfcgi to

Woppe 01-06-2010 01:23 PM

rnesius, you are my hero of today. Thanks alot.
I misinterpreted the manual pages for gcc regarding -l flag.

All times are GMT -5. The time now is 05:56 PM.