Autoconf Error on Ubuntu 11.04

I spent some time searching and installing libraries, but I could not deal with this problem using autoconf.

I downloaded the program I want to compile, made some changes and you need to run autogen.sh and. / configure and install accordingly.

however, when I try to run autogen.sh, I get the following error:

configure.ac:225: error: possibly undefined macro: AM_PATH_GTK_2_0 If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. 

so I continued, downloaded autoconf-2.68, automake-1.11, m4-1.4.16 and tried sudo apt-get install libgtk2.0-dev, none of which changed the result. when i try aclocal i get error again

 configure.ac:225: warning: macro `AM_PATH_GTK_2_0' not found in library 

I'm currently stuck and I have nowhere to go. so I would be happy for any suggestion.

+6
source share
3 answers

Given the name AM_PATH_GTK_2_0, the following sequence of observations is made: 1) "AM_" is in the automake namespace, so the m4 macro must come from automake. 2) Hmmm, this is not in automake. 3) This probably comes from gtk, so the gtk developer made a mistake when naming their m4 macro in conflict with automake. This is a bug in gtk, but I will probably need to download the latest gtk to get the macro.

The problem is that you don't have the m4 macro, which you expect is gtk. You probably need to install libgtk-devel (or something like that). If I'm right, and libgtk does install the m4 macro with the name AM _..., report this as a bug for developers. They stomp in the automakes namespace (this is, unfortunately, an extremely common mistake.)

Since you mention downloading automake, I think the problem is that you are using aclocal, which is not looking for / usr / share / aclocal, but in a different place (i.e. you installed automake in / usr / local) When you installed libgtk -dev, he probably installed the * .m4 file in / usr / share / aclocal, but you need this file in / usr / local / share / aclocal (or $ prefix / share / aclocal, where the prefix is ​​what you used automake to install.) The easiest solution is to copy this file to $ (aclocal -print). That is, run "aclocal -print" to see where aclocal is looking for m4 files, and then find the file that is installed by libgtk-dev that defines the unnamed macro m4 and copies this file to the appropriate location. Alternatively (and probably the best solution), you can put a file called dirlist in $ (aclocal -print) that contains one line of "/ usr / share / aclocal", so your manual installation of aclocal will always look for m4 files that installed in / usr / share.

+5
source

I know this a bit later, but you just need to install the libgtk2.0-dev library:

 sudo apt-get install libgtk2.0-dev 

If you get errors about something related to GLIB, then install libglib2.0-dev :

 sudo apt-get install libglib2.0-dev 
+11
source

In case of the same problem on CenOS / RedHat:

 sudo yum install gtk2-devel 
0
source

Source: https://habr.com/ru/post/899519/


All Articles