Hello. I have been trying to build gimp from source. Yer, every time I execute configure, it fails with a message

Code:
*** Could not run GTK+ test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GTK+ is incorrectly installed.
configure: error: Test for GTK+ failed. See the file 'INSTALL' for help
Looking into config.log, there is:
Code:
configure:28333: gcc -o conftest -g -O2 -Wall -Wdeclaration-after-statement -Wmissing-prototypes -Wmissing-declarations -Winit-self -Wpointer-arith -Wold-style-definition  -I/media/34GB/Arquivos-de-Programas-Linux/xorg/X11-1.4.4/include -I/media/34GB/Arquivos-de-Programas-Linux/xorg/Xorgproto-2018.1/include/ -I/media/34GB/Arquivos-de-Programas-Linux/Gtk+-2.24.20/include/gtk-2.0/ -I/media/34GB/Arquivos-de-Programas-Linux/Glib-2.32.0/include/glib-2.0/ -I/media/34GB/Arquivos-de-Programas-Linux/Glib-2.32.0/lib/glib-2.0/include/ -I/media/34GB/Arquivos-de-Programas-Linux/Cairo-1.10.0/include/cairo/ -I/media/34GB/Arquivos-de-Programas-Linux/Pango-1.30.0/include/pango-1.0/ -I/media/34GB/Arquivos-de-Programas-Linux/Gtk+-2.24.20/lib/gtk-2.0/include/ -I/media/34GB/Arquivos-de-Programas-Linux/Gdk-pixbuf-2.25.2/include/gdk-pixbuf-2.0/ -I/media/34GB/Arquivos-de-Programas-Linux/Atk-2.15.4/include/atk-1.0/ -L/media/34GB/Arquivos-de-Programas-Linux/xorg/X11-1.4.4/lib/ conftest.c   >&5
conftest.c: In function 'main':
conftest.c:50:1: warning: old-style function definition [-Wold-style-definition]
 main ()
 ^
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 and 3 information.
/tmp/ccB33dRl.o: In function `main':
conftest.c:(.text.startup+0x2): undefined reference to `gtk_major_version'
/usr/bin/ld: Dwarf Error: found dwarf version '0', this reader only handles version 2 and 3 information.
conftest.c:(.text.startup+0x11): undefined reference to `gtk_minor_version'
/usr/bin/ld: Dwarf Error: found dwarf version '315', this reader only handles version 2 and 3 information.
conftest.c:(.text.startup+0x1c): undefined reference to `gtk_micro_version'
collect2: error: ld returned 1 exit status
configure:28339: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME "GIMP"
| #define PACKAGE_TARNAME "gimp"
| #define PACKAGE_VERSION "2.6.0"
| #define PACKAGE_STRING "GIMP 2.6.0"
| #define PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=GIMP"
| #define GETTEXT_PACKAGE "gimp20"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define ARCH_X86 1
| #define ARCH_X86_64 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_WAIT_H 1
| #define TIME_WITH_SYS_TIME 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_SYS_TIMES_H 1
| #define HAVE_SYS_WAIT_H 1
| #define HAVE_UNISTD_H 1
| #define RETSIGTYPE void
| #define HAVE_VPRINTF 1
| #define HAVE_ALLOCA_H 1
| #define HAVE_ALLOCA 1
| #define HAVE_DIFFTIME 1
| #define HAVE_MMAP 1
| #define HAVE__NL_MEASUREMENT_MEASUREMENT 1
| #define HAVE_LOCALE_H 1
| #define HAVE_LC_MESSAGES 1
| #define HAVE_BIND_TEXTDOMAIN_CODESET 1
| #define HAVE_GETTEXT 1
| #define HAVE_DCGETTEXT 1
| #define ENABLE_NLS 1
| #define HAVE_ISO_CODES 1
| #define HAVE_BIND_TEXTDOMAIN_CODESET 1
| /* end confdefs.h.  */
| 
| #include <gtk/gtk.h>
| #include <stdio.h>
| 
| int
| main ()
| {
|  return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version));
|   ;
|   return 0;
| }
configure:28370: error: Test for GTK+ failed. See the file 'INSTALL' for help.
Then I tried to build this test by my own:

Code:
#include <gtk/gtk.h>
 #include <stdio.h>
 
 int
 main ()
 {
  return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version));
   ;
   return 0;
 }
with
Code:
gcc -o conftest2 -I /media/34GB/Arquivos-de-Programas-Linux/Gtk+-2.24.20/include/gtk-2.0/ -I /media/34GB/Arquivos-de-Programas-Linux/Cairo-1.10.0/include/cairo/ -I /media/34GB/Arquivos-de-Programas-Linux/Glib-2.32.0/include/glib-2.0/ -I /media/34GB/Arquivos-de-Programas-Linux/Glib-2.32.0/lib/glib-2.0/include/ -I /media/34GB/Arquivos-de-Programas-Linux/Pango-1.30.0/include/pango-1.0/ -I /media/34GB/Arquivos-de-Programas-Linux/Gtk+-2.24.20/lib/gtk-2.0/include/ -I /media/34GB/Arquivos-de-Programas-Linux/Atk-2.15.4/include/atk-1.0/ -I /media/34GB/Arquivos-de-Programas-Linux/Gdk-pixbuf-2.25.2/include/gdk-pixbuf-2.0/ conftest2.c
and received:
Code:
/tmp/ccCdzV54.o: In function `main':
conftest2.c:(.text+0x6): undefined reference to `gtk_major_version'
conftest2.c:(.text+0x10): undefined reference to `gtk_minor_version'
conftest2.c:(.text+0x1a): undefined reference to `gtk_micro_version'
collect2: error: ld returned 1 exit status
I tried to check if the system gtk had these
gtk_whatever_version
on it and executed:

Code:
nm -s /usr/lib/libgtk-x11-2.0.so.0.2000.0 | grep gtk_major_version
that returned:
nm: /usr/lib/libgtk-x11-2.0.so.0.2000.0: no symbols
I then tested with my two own built libgtk:

Code:
 nm -s /media/34GB/Arquivos-de-Programas-Linux/Gtk+-2.24.20/lib/libgtk-x11-2.0.so.0.2400.20 | grep gtk_major_version
that returned
Code:
0000000000344f64 R gtk_major_version
and
Code:
nm -s /media/34GB/Arquivos-de-Programas-Linux-32bit/Gtk+-2.12.0/lib/libgtk-x11-2.0.so.0.1200.0 | grep gtk_major_version
that returned:

Code:
003821c0 R gtk_major_version
Then I did my last attempts, tried to build the conftest example using my own gtks (-L added).

Code:
gcc -o conftest2 -I /media/34GB/Arquivos-de-Programas-Linux/Gtk+-2.24.20/include/gtk-2.0/ -I /media/34GB/Arquivos-de-Programas-Linux/Cairo-1.10.0/include/cairo/ -I /media/34GB/Arquivos-de-Programas-Linux/Glib-2.32.0/include/glib-2.0/ -I /media/34GB/Arquivos-de-Programas-Linux/Glib-2.32.0/lib/glib-2.0/include/ -I /media/34GB/Arquivos-de-Programas-Linux/Pango-1.30.0/include/pango-1.0/ -I /media/34GB/Arquivos-de-Programas-Linux/Gtk+-2.24.20/lib/gtk-2.0/include/ -I /media/34GB/Arquivos-de-Programas-Linux/Atk-2.15.4/include/atk-1.0/ -I /media/34GB/Arquivos-de-Programas-Linux/Gdk-pixbuf-2.25.2/include/gdk-pixbuf-2.0/ -L /media/34GB/Arquivos-de-Programas-Linux/Gtk+-2.24.20/lib/ conftest2.c
and

Code:
gcc -m32 -o conftest2 -I /media/34GB/Arquivos-de-Programas-Linux-32bit/Gtk+-2.12.0/include/gtk-2.0/ -I /media/34GB/Arquivos-de-Programas-Linux-32bit/Cairo-1.2.6/include/cairo/ -I /media/34GB/Arquivos-de-Programas-Linux-32bit/Glib-2.20.0/include/glib-2.0/ -I /media/34GB/Arquivos-de-Programas-Linux-32bit/Glib-2.20.0/lib/glib-2.0/include/ -I /media/34GB/Arquivos-de-Programas-Linux-32bit/Pango-1.20.5/include/pango-1.0/ -I /media/34GB/Arquivos-de-Programas-Linux-32bit/Gtk+-2.12.0/lib/gtk-2.0/include/ -I /media/34GB/Arquivos-de-Programas-Linux-32bit/Atk-1.29.2/include/atk-1.0/ -L /media/34GB/Arquivos-de-Programas-Linux-32bit/Gtk+-2.12.0/lib/  conftest2.c
Both returned:

Code:
conftest2.c:(.text+0x4): undefined reference to `gtk_major_version'
conftest2.c:(.text+0xd): undefined reference to `gtk_minor_version'
conftest2.c:(.text+0x16): undefined reference to `gtk_micro_version'
So, any suggestions as to why this is happening?