LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-05-2008, 01:57 PM   #1
violagirl23
Member
 
Registered: Aug 2007
Location: Michigan
Distribution: Gentoo, Arch
Posts: 33

Rep: Reputation: 15
aclocal gives warning with my configure.ac with gtkmm, did something wrong?


I'm trying to use my first make file, and it's my first program with gtkmm....
But I think I'm doing something wrong. I made my configure.ac file, here it is:
Code:
AC_INIT(src/firstwindow.cpp)
AM_INIT_AUTOMAKE(firstwindow,0.1)
AC_PROG_CC
AC_PROG_CXX
PKG_CHECK_MODULES([MYAPP], [gtkmm-2.4 >= 2.8.0])
AC_PROG_INSTALL
AC_OUTPUT(Makefile src/Makefile)
But if I then run aclocal, it has a problem with the PKG_CHECK_MODULES line for the GTK.
It prints out:
Code:
aclocal
/usr/share/aclocal/gtkgl.m4:4: warning: underquoted definition of AM_PATH_GTKGL
/usr/share/aclocal/gtkgl.m4:4:   run info '(automake)Extending aclocal'
/usr/share/aclocal/gtkgl.m4:4:   or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
Am I not even supposed to use aclocal? Ive never used a make file before, so I was just trying to follow the instructions...


The program DOES fail to compile later because it isn't using the GTK library... so that's probably the problem.
It says:
Code:
 make
Making all in src
make[1]: Entering directory `/home/violagirl23/programs/firstwindow/src'
g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"firstwindow\" -DVERSION=\"0.1\" -I.     -g -O2 -MT firstwindow.o -MD -MP -MF .deps/firstwindow.Tpo -c -o firstwindow.o firstwindow.cpp
firstwindow.cpp:1:19: error: gtkmm.h: No such file or directory
firstwindow.cpp: In function ‘int main(int, char**)’:
firstwindow.cpp:5: error: ‘Gtk’ has not been declared
firstwindow.cpp:5: error: expected `;' before ‘kit’
firstwindow.cpp:6: error: ‘Gtk’ has not been declared
firstwindow.cpp:6: error: expected `;' before ‘window’
firstwindow.cpp:7: error: ‘Gtk’ has not been declared
firstwindow.cpp:7: error: ‘window’ was not declared in this scope
make[1]: *** [firstwindow.o] Error 1
make[1]: Leaving directory `/home/violagirl23/programs/firstwindow/src'
make: *** [all-recursive] Error 1
Eep! I KNOW I have gtkmm, I got it to compile with just g++ like this:
Code:
g++ `pkg-config gtkmm-2.4 --cflags --libs`'
So what could be the problem here?
 
Old 02-05-2008, 04:45 PM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Those warnings from aclocal are quite commonly seen and non-fatal.
 
Old 02-05-2008, 07:14 PM   #3
violagirl23
Member
 
Registered: Aug 2007
Location: Michigan
Distribution: Gentoo, Arch
Posts: 33

Original Poster
Rep: Reputation: 15
Hm, then I must have another problem as for why it is not compiling... :/
I'm sure I'm missing something so simple...
So I think I'm just doing something wrong in general, forgetting something.
Here is my current configure.ac:
Quote:
AC_INIT(src/firstwindow.cpp)
AM_INIT_AUTOMAKE(firstwindow,0.1)
AC_PROG_CC
AC_PROG_CXX
PKG_CHECK_MODULES([firstwindow], [gtkmm-2.4 >= 2.8.0])
AC_PROG_INSTALL
AC_OUTPUT(Makefile src/Makefile)
I am using this tutorial: http://www.gtkmm.org/docs/gtkmm-2.4/...d-linking.html
and it says:
Quote:
To simplify compilation, we use pkg-config, which is present in all (properly installed) gtkmm installations. This program 'knows' what compiler switches are needed to compile programs that use gtkmm. The --cflags option causes pkg-config to output a list of include directories for the compiler to look in; the --libs option requests the list of libraries for the compiler to link with and the directories to find them in. Try running it from your shell-prompt to see the results on your system.

However, this is even simpler when using the PKG_CHECK_MODULES() macro in a standard configure.ac file with autoconf and automake. For instance:

PKG_CHECK_MODULES([MYAPP], [gtkmm-2.4 >= 2.8.0])

This checks for the presence of gtkmm and defines MYAPP_LIBS and MYAPP_CFLAGS for use in your Makefile.am files.
When they said MYAPP, I wasn't sure if they literally meant "MYAPP" or the name of my application, which is firstwindow. I tried the latter.
Now, are they say I need to put something in my Makefile.am as well?
I tried putting the lines firstwindow_LIBS and firstwindow_CFLAGS in there and it wouldn't even let me do make, just gave an error about separators.
So I think I'm just missing some general concept here.... could anyone enlighten me? Because I'm still not very familiar with make files...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] WARNING: `aclocal-1.6' is needed lord_didger Linux - Software 3 09-03-2005 03:47 PM
WARNING: Hard link count is wrong for /proc Fr33B5D Linux - General 1 08-30-2005 06:41 PM
cdrecord returns wrong startsec warning parthenios Linux - Hardware 1 03-05-2005 12:50 AM
aclocal configure.ac or configure.in required shooterfpga Linux - General 1 01-19-2005 05:38 AM
configure wants lower version of aclocal aus9 Slackware 2 01-20-2004 10:01 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration