Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » need help with glib

This thread is locked; no one can reply to it. rss feed Print
need help with glib
Doctor Cop
Member #16,833
April 2018
avatar

I was trying to compile glib but it kept telling me this error
I tried stack overflow but it wasn't helpful.
Please help me!

Dell@Dell-PC MINGW64 ~/Desktop/glib-2.54.3
$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '197608' is supported by ustar format... yes
checking whether GID '197121' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define _EXTENSIONS_... yes
checking build system type... x86_64-pc-mingw64
checking host system type... x86_64-pc-mingw64
checking for Win32... yes
checking for the Android... no
checking for Mac OS X Carbon support... no
checking for Mac OS X Cocoa support... no
checking for windres... windres
checking for nm... nm
checking for ranlib... ranlib
checking for dlltool... dlltool
checking for lib.exe... no
checking whether to enable garbage collector friendliness... no
checking whether to disable memory pools... no
checking for c++... c++
checking whether we are using the GNU C++ compiler... yes
checking whether c++ accepts -g... yes
checking dependency style of c++... gcc3
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... unknown
checking for _LARGE_FILES value needed for large files... unknown
checking for pkg-config... no
checking how to get MSVC-compatible struct packing... -mms-bitfields
checking for gawk... (cached) gawk
checking for perl5... no
checking for perl... perl
checking for indent... indent
checking for perl... /usr/bin/perl
checking for a Python interpreter with version >= 2.7... python
checking for python... /c/Python36/python
checking for python version... 3.6
checking for python platform... win32
checking for python script directory... ${prefix}/lib/python3.6/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.6/site-packages
checking for ZLIB... no
checking for inflate in -lz... no
configure: error: *** Working zlib library and headers not found ***

I reinstalled Zlib binaries, even tried to build from source but everything failed.
I have zlib1.dll in my MinGW folder which is already in my system environment path.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Well, it's clear you haven't installed zlib correctly. First, it's not looking for binaries. It wants archive libraries and headers, which you didn't install properly. Having zlib1.dll on the %PATH% makes no difference when trying to compile a program. They're only for runtime use. I mean, technically you can link to a .dll, but that's only because MinGW isn't made by idiots and gcc makes it easy. It's like linking to a .so file on Linux.

Having said that, you need to install zlib development packages.

You say you're using MinGW, but from where? And in what context? MSYS? MSYS2? I see you're running configure, and that only comes with linux or msys.

And you say the MinGW folder is on your path, but that is misleading. Do you mean C:\MinGW\bin is on your %PATH%? Or C:\MinGW, because that would be wrong.

Now, you don't want to compile zlib with configure that's a waste of time. Use CMake and save yourself the hassle.

Also, what are you using glib for? Minimum supported windows version is 7, if you don't mind cutting off half of your potential users.

It looks like glib only supports configure, so you're using msys I assume.

configure is dumb as bricks, so you'll have to install zlib to your compiler directory (c:\mingw\lib , c:\mingw\include) before you can compile glib. It says you need python but it looks like you've already got that.

Help us help you by giving us more information. Show us console output and what you typed to get there.

Doctor Cop
Member #16,833
April 2018
avatar

you said

  • "You say you're using MinGW, but from where?"

I have installed TDM-GCC-32 and I have installed autotools separately and latest version of make.

I am using zlib from this link https://sourceforge.net/projects/gnuwin32/files/zlib/1.2.3/zlib-1.2.3-src.zip/download?use_mirror=excellmedia&download=

yes my env path is MinGW/bin

I have attached some files, please tell me what to do?

I am building glib for libiohook, I couldn't find any other good hooking library,
please tell me if you know some!

Peter Hull
Member #1,136
March 2001

Have you got pkg-config installed?
If you do

pkg-config --cflags zlib

what does it say?

Basically configure can't find your zlib headers and/or library so you need to either
1. Copy them to where configure is looking
2. Tell configure where they are

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

zlib 1.2.3 is 8 versions older than 1.2.11. 1.2.11 is the version I'm using and I have no problems building it.

Just use CMake for Zlib, using cmake-gui.

It's as easy as :

cd zlib
mkdir build
cd build
cmake-gui ..
(configure cmake and generate makefiles)
mingw32-make
mingw32-make install

You'll need to change the install directory inside cmake-gui, because it defaults to Program Files, which is ridiculous.

What are you using hooking for? Low level hooks usually aren't necessary. And there are far easier ways to write a keylogger.

Doctor Cop
Member #16,833
April 2018
avatar

Peter Hull said

"Have you got pkg-config installed?
If you do
,
pkg-config --cflags zlib

what does it say?"

I need glib to build pkg-config.
pkg-config is needed to build libiohook.

"Basically configure can't find your zlib headers and/or library so you need to either
1. Copy them to where configure is looking
2. Tell configure where they are "

I tried to change path in configure file but I couldn't find a way to do so.
basically I don't know how configure works, I just search google whenever I encounter an error. File is attached.

Edgar Reynaldo :
* I found headers and libs for zlib now the problem is how to tell the configure file where they are.

* I am using hooking for a test project. I need to make a real time employee monitoring system.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

  • I am using hooking for a test project. I need to make a real time employee monitoring system.

I am sure there are working solutions out there already, so unless you're under contract to do this, it seems silly to write one from scratch. Do some googling for real time network monitoring. I'm sure there's software out there for this already.

But do what you want.

Don't post your configure file, I don't want that thing. I said earlier, you need to install zlib to your compiler directory's lib and include folders. Then configure will find it.

Also, when you run configure, pass --prefix=/c/mingw and then libiohook and glib will be installed to your compiler directory for you.

Quote:

  • I found headers and libs for zlib now the problem is how to tell the configure file where they are.

What do you mean 'found' them? Vagueness is the bane of the internet. Are they ones you built yourself? Or did you download them from somewhere? They have to be compatible with your compiler or else they won't work.

Doctor Cop
Member #16,833
April 2018
avatar

Edgar yes I downloaded them and they are of the same version.

I found them at SourceForge.

New errors are:

checking for perl5... no
checking for perl... perl
checking for indent... indent
checking for perl... /usr/bin/perl
checking for a Python interpreter with version >= 2.7... python
checking for python... /c/Python36/python
checking for python version... 3.6
checking for python platform... win32
checking for python script directory... ${prefix}/lib/python3.6/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python3.6/site-packages
checking for ZLIB... no
checking for inflate in -lz... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for LIBFFI... no
configure: error: in `/c/Users/Dell/Desktop/glib-2.54.3':
configure: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.

Alternatively, you may set the environment variables LIBFFI_CFLAGS
and LIBFFI_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Peter Hull
Member #1,136
March 2001

Edgar, what's your opinion on "TDM-GCC-32" which is what Dr Cop is using? As far as I can see (website) it's pretty old and pretty limited. Do you think MSYS2 would be better?

As I understand it, MSYS2 comes with a package manager so getting zlib etc. should be trivial. In fact you can get glibc from the package manager and skip this step altogether!

Doctor Cop, could you use MSYS2 instead of TDM-GCC?

Doctor Cop
Member #16,833
April 2018
avatar

Thanks for your help, now I'm looking for some tutorial to autoconf.
Thnks for MSYS suggestion. I have MSYS2 but never used it, now I'm going to.

Now I have checked it, and installed it.
Lets see if it works.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

I didn't know they were still updating TDM. :/ ??? shrug

I would personally use recommend MSYS 1.0, not 2.0 even if it does come with a package manager. MSYS 2 doesn't come with cmake-gui unless you get gtk and that is huge. But MSYS2 would make a lot of things easier for you.

I provide an old distro of MSYS 1.0.11 here :
https://bitbucket.org/bugsquasher/unofficial-allegro-5-binaries/downloads/MSYS_1pt0pt11.7z

Peter Hull
Member #1,136
March 2001

I didn't know they were still updating TDM

Last update July 2015!

Go to: