I am trying to configure gpac. I get the error as follows.
[root@ffmpeg gpac]# ./configure
error: zlib not found on system or in local libs
I have installed zlib on custom path /usr/local/myapps. I know the above error occurs when devel package or .h file is not present. Its present on the server.
[root@ffmpeg gpac]# ll /usr/local/myapps/include/zlib.h
-rw-r--r-- 1 root root 79564 Jul 4 02:12 /usr/local/myapps/include/zlib.h
[/code[
I have given environment variables as follows.
LIBS=-L/usr/local/myapps/lib
PKG_CONFIG_PATH=/usr/local/myapps/lib/pkgconfig
LDFLAGS=-L/usr/local/myapps/lib
CPPFLAGS=-I/usr/local/myapps/include
PATH=/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin::/root/bin:/usr/local/myapps/bin
How to make the gpac configure script recognize the zlib.h file from the path /usr/local/myapps/include ? I made a symlink to /usr/include/zlib.h and it did not work. Installing zlib-devel via yum solves the problem. But yum installs a differerent zlib version. I need to use custom zlib.
CPPFLAGS=-I/usr/local/myapps/include
CFLAGS=-I/usr/local/myapps/include
cat > $TMPC << EOF
#include <zlib.h>
int main( void ) { if (zlibVersion() != ZLIB_VERSION) { puts("zlib version differs !!!"); return 1; } return 0; }
EOF
has_zlib="no"
if $cc -o $TMPO $TMPC -lz 2> /dev/null ; then
has_zlib="system"
elif $cc -o $TMPO $TMPC -I$local_inc/zlib -L$local_lib -lz 2> /dev/null ; then
has_zlib="local"
else
echo "error: zlib not found on system or in local libs"
exit 1
fi
error:
[root@ffmpeg gpac]# ./configure
error: zlib not found on system or in local libs
firstly , remove the stderr sending null and lets see what happen
probably , error occurs due to another things,maybe variables (be sure all variables is defined like TMPC,TMPO..)
and you can try with this (more specific)
.......
cat > $TMPC << EOF
#include<stdio.h>
#include <zlib.h>
#include <string.h>
int main( void ) {
static const char* curV = ZLIB_VERSION;
if (zlibVersion()[0] != curV[0]) {
printf("zlib versions has major different using..%s and,currently in system..%s\n" ,zlibVersion(),ZLIB_VERSION);
return 1;}
else if ( strcmp (zlibVersion(),ZLIB_VERSION) != 0 ) {
printf( "you are using %s, cur version %s.\n",zlibVersion(),ZLIB_VERSION);
}
return 0;
}
EOF
....
...
I removed the stderr and got the following error. I have echoed variables. Let me know if any other variable I should echo. Its not checking the path /usr/local/myapps/include/ where zlib.h is present.
[root@ffmpeg gpac]# ./configure
CPPFLAGS -fno-strict-aliasing
CFLAGS -fno-strict-aliasing
CFLAGS -fno-strict-aliasing
cc gcc
TMPC /tmp/gpac-conf-7254-30179-4836.c
TMPO /tmp/gpac-conf-22952-30179-10957.o
local_inc /usr/src/gpac/extra_lib/include
local_lib extra_lib/lib/gcc
CPPFLAGS -fno-strict-aliasing --> I set after this to CPPFLAGS to the value below
CPPFLAGS -I/usr/local/myapps/include
/tmp/gpac-conf-7254-30179-4836.c:1:18: error: zlib.h: No such file or directory
/tmp/gpac-conf-7254-30179-4836.c: In function 'main':
/tmp/gpac-conf-7254-30179-4836.c:2: error: 'ZLIB_VERSION' undeclared (first use in this function)
/tmp/gpac-conf-7254-30179-4836.c:2: error: (Each undeclared identifier is reported only once
/tmp/gpac-conf-7254-30179-4836.c:2: error: for each function it appears in.)
error: zlib not found on system or in local libs