1

I tried to build GTK2 to Mac OS X EI Captain from source code. But by the environment variable (INCLUDE?), an error occurred and I failed to build. Please help me by advices?

Doesn't someone have the man who encountered to the following error?

hash.c:111:3: error: use of undeclared identifier 'free'
  obstack_init (&htab->mem_pool);
  ^
./obstack.h:294:65: note: expanded from macro 'obstack_init'
                  (void () (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
                                                                              ^
hash.c:53:28: note: expanded from macro 'obstack_chunk_free'
#define obstack_chunk_free free
                           ^
I think that gcc can't find include file malloc.h . I don't understand that it is correct.

First, I downloaded following packages. gtk+-2.24.30, glib-2.28.0,atk-1.29.2,pango-1.20.0,gdk-pixbuf-2.21.3, gettext-0.10.40

I executed the following.

$ cd gettext-0.10.40
$ ./configure
$ make
Then, the following error occurred.
hash.c:111:3: error: use of undeclared identifier 'free'
  obstack_init (&htab->mem_pool);
  ^
./obstack.h:294:65: note: expanded from macro 'obstack_init'
                  (void () (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
                                                                              ^
hash.c:53:28: note: expanded from macro 'obstack_chunk_free'
#define obstack_chunk_free free
                           ^
hash.c:121:3: warning: implicit declaration of function 'free' is invalid in C99
      [-Wimplicit-function-declaration]
  free (htab->table);
  ^
1 warning and 1 error generated.
malloc.h of usual distribution of the Linux exists at /usr/include but malloc.h of the Mac OS X EI Captain exists at /usr/include/sys. So I executed the following.
$ cd gettext-0.10.40
$ env CPPFLAGS=-I/usr/include/sys ./configure
$ make
However, the same error occurred. It is too hard for me to handle.

Thank you.

  • The problem has solved by oneself. I downloaded gtk-osx-build-setup.sh from (wiki.gnome.org/Projects/GTK+/OSX/Building), and executed as following. $ ./gtk-osx-build-setup.sh $ jhbuild bootstrap I must remove a lot of errors but could install GTK2 in Mac OS X EI Captain below basically. $ jhbuild build meta-gtk-osx-bootstrap meta-gtk-osx-core I must remove a lot of errors but could install GTK3 in Mac OS X EI Captain below basically too. $ jhbuild build meta-gtk-osx-bootstrap meta-gtk-osx-gtk3 – Naota Inamoto Jun 21 '16 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.