LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   gcc cannot find FastCGI libraries (http://www.linuxquestions.org/questions/programming-9/gcc-cannot-find-fastcgi-libraries-780303/)

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:
Code:

$ 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:
Code:

$ ls /usr/lib/libfcgi*
/usr/lib/libfcgi.a    /usr/lib/libfcgi.so      /usr/lib/libfcgi.so.0.0.0
/usr/lib/libfcgi++.a  /usr/lib/libfcgi++.so    /usr/lib/libfcgi++.so.0.0.0
/usr/lib/libfcgi.la    /usr/lib/libfcgi.so.0
/usr/lib/libfcgi++.la  /usr/lib/libfcgi++.so.0

I have tried to follow these instructions. The files in the tar.gz archive provided by FastCGI.com 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 libfcgi.so

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.