Z
Z
Zaur Ashurbekov2017-10-14 13:54:23
C++ / C#
Zaur Ashurbekov, 2017-10-14 13:54:23

How to compile it?

Hello Toaster!
I'm trying to build the program created in this article (fcgi + nginx) I found the libfcgi
library on github But I can't get it all together with gcc Last attempt was like this:

gcc -I /home/user/lessons/tests/include -o main  main.cpp -ldl -lfcgi -lpthread

How to collect this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
Zaur Ashurbekov, 2017-10-15
@zaurius

I ran the makefile from the libfcgi archive and it installed all the libraries by itself. Then I compiled everything with -lfcgi

J
jcmvbkbc, 2017-10-15
@jcmvbkbc

How to assemble this

The easiest way is to install the -dev package in your OS:
apt-get install libfcgi-dev
gcc -o main main.c -lfcgi -pthread

If religion or other restrictions do not allow setting -dev, you need to tell the compiler where to get libfcgi, just as you indicated where to get fcgiapp.h:
The ...tests/lib path is conditional, you will need to specify the directory where libfcgi.a or libfcgi.so is installed
Instead of -lpthread, it's more correct to write -pthread: -lpthread only links to libpthread, -pthread also defines the _REENTRANT macro for sources that are compiled with this option.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question