Can not make this project
I run `./configure' and everything is okay. but during make, it show up errors and warnings.
system: Ubuntu 12.04 64bit gcc: 4.8.4
[three@ubuntu(2): libfcgi-master]$ make
make all-recursive
make[1]: Entering directory `/home/three/WorkSpace/nginx/libfcgi-master'
Making all in libfcgi
make[2]: Entering directory `/home/three/WorkSpace/nginx/libfcgi-master/libfcgi'
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../include -pthread -g -O2 -Wall -MT libfcgi_la-fcgiapp.lo -MD -MP -MF .deps/libfcgi_la-fcgiapp.Tpo -c -o libfcgi_la-fcgiapp.lo `test -f 'fcgiapp.c' || echo './'`fcgiapp.c
mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I.. -I../include -pthread -g -O2 -Wall -MT libfcgi_la-fcgiapp.lo -MD -MP -MF .deps/libfcgi_la-fcgiapp.Tpo -c fcgiapp.c -fPIC -DPIC -o .libs/libfcgi_la-fcgiapp.o
fcgiapp.c: In function 'ProcessManagementRecord':
fcgiapp.c:1490:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
= MakeHeader(FCGI_GET_VALUES_RESULT, FCGI_NULL_REQUEST_ID,
^
fcgiapp.c:1495:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
((FCGI_UnknownTypeRecord *) response)->header
^
fcgiapp.c:1498:9: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
((FCGI_UnknownTypeRecord *) response)->body
^
gcc -DHAVE_CONFIG_H -I. -I.. -I../include -pthread -g -O2 -Wall -MT libfcgi_la-fcgiapp.lo -MD -MP -MF .deps/libfcgi_la-fcgiapp.Tpo -c fcgiapp.c -o libfcgi_la-fcgiapp.o >/dev/null 2>&1
mv -f .deps/libfcgi_la-fcgiapp.Tpo .deps/libfcgi_la-fcgiapp.Plo
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../include -pthread -g -O2 -Wall -MT libfcgi_la-fcgi_stdio.lo -MD -MP -MF .deps/libfcgi_la-fcgi_stdio.Tpo -c -o libfcgi_la-fcgi_stdio.lo `test -f 'fcgi_stdio.c' || echo './'`fcgi_stdio.c
gcc -DHAVE_CONFIG_H -I. -I.. -I../include -pthread -g -O2 -Wall -MT libfcgi_la-fcgi_stdio.lo -MD -MP -MF .deps/libfcgi_la-fcgi_stdio.Tpo -c fcgi_stdio.c -fPIC -DPIC -o .libs/libfcgi_la-fcgi_stdio.o
gcc -DHAVE_CONFIG_H -I. -I.. -I../include -pthread -g -O2 -Wall -MT libfcgi_la-fcgi_stdio.lo -MD -MP -MF .deps/libfcgi_la-fcgi_stdio.Tpo -c fcgi_stdio.c -o libfcgi_la-fcgi_stdio.o >/dev/null 2>&1
mv -f .deps/libfcgi_la-fcgi_stdio.Tpo .deps/libfcgi_la-fcgi_stdio.Plo
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../include -pthread -g -O2 -Wall -MT libfcgi_la-os_unix.lo -MD -MP -MF .deps/libfcgi_la-os_unix.Tpo -c -o libfcgi_la-os_unix.lo `test -f 'os_unix.c' || echo './'`os_unix.c
gcc -DHAVE_CONFIG_H -I. -I.. -I../include -pthread -g -O2 -Wall -MT libfcgi_la-os_unix.lo -MD -MP -MF .deps/libfcgi_la-os_unix.Tpo -c os_unix.c -fPIC -DPIC -o .libs/libfcgi_la-os_unix.o
os_unix.c: In function 'OS_Accept':
os_unix.c:1175:54: warning: pointer targets in passing argument 3 of 'accept' differ in signedness [-Wpointer-sign]
socket = accept(listen_sock, (struct sockaddr *)&sa, &len);
^
In file included from /usr/include/netinet/in.h:23:0,
from os_unix.c:28:
/usr/include/x86_64-linux-gnu/sys/socket.h:243:12: note: expected 'socklen_t * __restrict__' but argument is of type 'int *'
extern int accept (int __fd, __SOCKADDR_ARG __addr,
^
os_unix.c: In function 'OS_IsFcgi':
os_unix.c:1275:35: warning: pointer targets in passing argument 3 of 'getpeername' differ in signedness [-Wpointer-sign]
if (getpeername(sock, (struct sockaddr *)&sa, &len) != 0 && errno == ENOTCONN) {
^
In file included from /usr/include/netinet/in.h:23:0,
from os_unix.c:28:
/usr/include/x86_64-linux-gnu/sys/socket.h:141:12: note: expected 'socklen_t * __restrict__' but argument is of type 'int *'
extern int getpeername (int __fd, __SOCKADDR_ARG __addr,
^
gcc -DHAVE_CONFIG_H -I. -I.. -I../include -pthread -g -O2 -Wall -MT libfcgi_la-os_unix.lo -MD -MP -MF .deps/libfcgi_la-os_unix.Tpo -c os_unix.c -o libfcgi_la-os_unix.o >/dev/null 2>&1
mv -f .deps/libfcgi_la-os_unix.Tpo .deps/libfcgi_la-os_unix.Plo
/bin/bash ../libtool --tag=CC --mode=link gcc -pthread -g -O2 -Wall -o libfcgi.la -rpath /usr/local/lib libfcgi_la-fcgiapp.lo libfcgi_la-fcgi_stdio.lo libfcgi_la-os_unix.lo -lnsl
gcc -shared .libs/libfcgi_la-fcgiapp.o .libs/libfcgi_la-fcgi_stdio.o .libs/libfcgi_la-os_unix.o -lnsl -pthread -Wl,-soname -Wl,libfcgi.so.0 -o .libs/libfcgi.so.0.0.0
(cd .libs && rm -f libfcgi.so.0 && ln -s libfcgi.so.0.0.0 libfcgi.so.0)
(cd .libs && rm -f libfcgi.so && ln -s libfcgi.so.0.0.0 libfcgi.so)
ar cru .libs/libfcgi.a libfcgi_la-fcgiapp.o libfcgi_la-fcgi_stdio.o libfcgi_la-os_unix.o
ranlib .libs/libfcgi.a
creating libfcgi.la
(cd .libs && rm -f libfcgi.la && ln -s ../libfcgi.la libfcgi.la)
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -MT fcgio.lo -MD -MP -MF .deps/fcgio.Tpo -c -o fcgio.lo fcgio.cpp
g++ -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -MT fcgio.lo -MD -MP -MF .deps/fcgio.Tpo -c fcgio.cpp -fPIC -DPIC -o .libs/fcgio.o
g++ -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -MT fcgio.lo -MD -MP -MF .deps/fcgio.Tpo -c fcgio.cpp -o fcgio.o >/dev/null 2>&1
mv -f .deps/fcgio.Tpo .deps/fcgio.Plo
/bin/bash ../libtool --tag=CXX --mode=link g++ -g -O2 -lfcgi -rpath /usr/local/lib -o libfcgi++.la fcgio.lo -lnsl
g++ -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbeginS.o .libs/fcgio.o -Wl,--rpath -Wl,/home/three/WorkSpace/nginx/libfcgi-master/libfcgi/.libs /home/three/WorkSpace/nginx/libfcgi-master/libfcgi/.libs/libfcgi.so -lnsl -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/4.8/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o -Wl,-soname -Wl,libfcgi++.so.0 -o .libs/libfcgi++.so.0.0.0
(cd .libs && rm -f libfcgi++.so.0 && ln -s libfcgi++.so.0.0.0 libfcgi++.so.0)
(cd .libs && rm -f libfcgi++.so && ln -s libfcgi++.so.0.0.0 libfcgi++.so)
ar cru .libs/libfcgi++.a fcgio.o
ranlib .libs/libfcgi++.a
creating libfcgi++.la
(cd .libs && rm -f libfcgi++.la && ln -s ../libfcgi++.la libfcgi++.la)
make[2]: Leaving directory `/home/three/WorkSpace/nginx/libfcgi-master/libfcgi'
Making all in cgi-fcgi
make[2]: Entering directory `/home/three/WorkSpace/nginx/libfcgi-master/cgi-fcgi'
gcc -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -Wall -MT cgi-fcgi.o -MD -MP -MF .deps/cgi-fcgi.Tpo -c -o cgi-fcgi.o cgi-fcgi.c
cgi-fcgi.c: In function ‘WebServerReadHandler’:
cgi-fcgi.c:390:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
= MakeHeader(FCGI_STDIN, requestId, bytesRead, 0);
^
cgi-fcgi.c: In function ‘ScheduleIo’:
cgi-fcgi.c:461:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
(ClientData)appServerSock) == -1) {
^
cgi-fcgi.c:477:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
(ClientData)appServerSock) == -1) {
^
cgi-fcgi.c: In function ‘ParseArgs’:
cgi-fcgi.c:643:9: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Wformat=]
strlen(tp1)+1);
^
cgi-fcgi.c: In function ‘main’:
cgi-fcgi.c:725:9: warning: variable ‘numFDs’ set but not used [-Wunused-but-set-variable]
int numFDs;
^
mv -f .deps/cgi-fcgi.Tpo .deps/cgi-fcgi.Po
/bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -o cgi-fcgi cgi-fcgi.o ../libfcgi/libfcgi.la -lnsl
mkdir .libs
gcc -g -O2 -Wall -o .libs/cgi-fcgi cgi-fcgi.o ../libfcgi/.libs/libfcgi.so -lnsl
creating cgi-fcgi
make[2]: Leaving directory `/home/three/WorkSpace/nginx/libfcgi-master/cgi-fcgi'
Making all in examples
make[2]: Entering directory `/home/three/WorkSpace/nginx/libfcgi-master/examples'
gcc -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -Wall -MT authorizer.o -MD -MP -MF .deps/authorizer.Tpo -c -o authorizer.o authorizer.c
mv -f .deps/authorizer.Tpo .deps/authorizer.Po
/bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -o authorizer authorizer.o ../libfcgi/libfcgi.la -lnsl
mkdir .libs
gcc -g -O2 -Wall -o .libs/authorizer authorizer.o ../libfcgi/.libs/libfcgi.so -lnsl
creating authorizer
gcc -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -Wall -MT echo.o -MD -MP -MF .deps/echo.Tpo -c -o echo.o echo.c
mv -f .deps/echo.Tpo .deps/echo.Po
/bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -o echo echo.o ../libfcgi/libfcgi.la -lnsl
gcc -g -O2 -Wall -o .libs/echo echo.o ../libfcgi/.libs/libfcgi.so -lnsl
creating echo
gcc -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -Wall -MT echo-x.o -MD -MP -MF .deps/echo-x.Tpo -c -o echo-x.o echo-x.c
mv -f .deps/echo-x.Tpo .deps/echo-x.Po
/bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -o echo-x echo-x.o ../libfcgi/libfcgi.la -lnsl
gcc -g -O2 -Wall -o .libs/echo-x echo-x.o ../libfcgi/.libs/libfcgi.so -lnsl
creating echo-x
gcc -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -Wall -MT log-dump.o -MD -MP -MF .deps/log-dump.Tpo -c -o log-dump.o log-dump.c
mv -f .deps/log-dump.Tpo .deps/log-dump.Po
/bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -o log-dump log-dump.o ../libfcgi/libfcgi.la -lnsl
gcc -g -O2 -Wall -o .libs/log-dump log-dump.o ../libfcgi/.libs/libfcgi.so -lnsl
creating log-dump
gcc -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -Wall -MT size.o -MD -MP -MF .deps/size.Tpo -c -o size.o size.c
mv -f .deps/size.Tpo .deps/size.Po
/bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -o size size.o ../libfcgi/libfcgi.la -lnsl
gcc -g -O2 -Wall -o .libs/size size.o ../libfcgi/.libs/libfcgi.so -lnsl
creating size
gcc -DHAVE_CONFIG_H -I. -I.. -I../include -pthread -g -O2 -Wall -MT threaded-threaded.o -MD -MP -MF .deps/threaded-threaded.Tpo -c -o threaded-threaded.o `test -f 'threaded.c' || echo './'`threaded.c
threaded.c: In function ‘doit’:
threaded.c:27:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
int rc, i, thread_id = (int)a;
^
threaded.c: In function ‘main’:
threaded.c:80:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
pthread_create(&id[i], NULL, doit, (void*)i);
^
mv -f .deps/threaded-threaded.Tpo .deps/threaded-threaded.Po
/bin/bash ../libtool --tag=CC --mode=link gcc -pthread -g -O2 -Wall -pthread -o threaded threaded-threaded.o ../libfcgi/libfcgi.la -lnsl
gcc -pthread -g -O2 -Wall -pthread -o .libs/threaded threaded-threaded.o ../libfcgi/.libs/libfcgi.so -lnsl
creating threaded
g++ -DHAVE_CONFIG_H -I. -I.. -I../include -g -O2 -MT echo-cpp.o -MD -MP -MF .deps/echo-cpp.Tpo -c -o echo-cpp.o echo-cpp.cpp
mv -f .deps/echo-cpp.Tpo .deps/echo-cpp.Po
/bin/bash ../libtool --tag=CXX --mode=link g++ -g -O2 -o echo-cpp echo-cpp.o ../libfcgi/libfcgi++.la -lnsl
g++ -g -O2 -o .libs/echo-cpp echo-cpp.o ../libfcgi/.libs/libfcgi++.so -lnsl
/usr/bin/ld: echo-cpp.o: undefined reference to symbol 'FCGX_InitRequest'
//home/three/WorkSpace/nginx/libfcgi-master/libfcgi/.libs/libfcgi.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [echo-cpp] Error 1
make[2]: Leaving directory `/home/three/WorkSpace/nginx/libfcgi-master/examples'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/three/WorkSpace/nginx/libfcgi-master'
make: *** [all] Error 2
Do you have libfcgi dev package installed?
I haven't install libfcgi dev package. But now I installed libfcgi-dev package and it works well. So I don't use this libfcgi any more. Thank you very much !
make clean solves the problem.
Hello,
I have the same issue, that the symbol FCGX_InitRequest is missing for builds of shared library.
But if I call ./configure --disable-shared, then the build succeeds.
I have found the cause of the problem: https://github.com/toshic/libfcgi/blob/f3cef74607d4770c590c52fe9b9dd7c702149cd5/examples/Makefile.am#L37 This line should become this:
echo_cpp_LDADD = $(LIBDIR)/libfcgi++.la $(LIBDIR)/libfcgi.la
It is better to send these fixes to debian, this fork was made just to send changes to debian.
Hello @toshic according to https://packages.debian.org/buster/libfcgi-dev the upstream project seems to be https://github.com/FastCGI-Archives/fcgi2 (git tag 2.4.0 ) Do you agree?