[Résolu] Compilation C++ et gtkmm

Bonjour tout le monde, je cherche à compiler un programme que je code actuellement mais il y a quelque chose qui m’échappe autour de gtkmm et des autotools…

Voici la structure de mon projet :

phil@laptop-ph:~/workspace/gaffer$ ls -lah total 436K drwxr-xr-x 4 phil phil 4,0K jui 19 08:54 . drwxr-xr-x 4 phil phil 4,0K jui 18 18:04 .. -rw-r--r-- 1 phil phil 37K jui 19 08:39 aclocal.m4 -rw-r--r-- 1 phil phil 0 jui 16 21:08 AUTHORS drwxr-xr-x 2 phil phil 4,0K jui 19 08:39 autom4te.cache -rw-r--r-- 1 phil phil 0 jui 18 18:10 autoscan.log -rw-r--r-- 1 phil phil 0 jui 16 21:08 ChangeLog -rw-r--r-- 1 phil phil 16K jui 19 08:54 config.log -rwxr-xr-x 1 phil phil 30K jui 18 18:14 config.status -rwxr-xr-x 1 phil phil 181K jui 19 08:39 configure -rw-r--r-- 1 phil phil 616 jui 18 18:14 configure.ac -rw-r--r-- 1 phil phil 35K jui 18 18:14 COPYING -rwxr-xr-x 1 phil phil 18K jui 18 18:14 depcomp -rw-r--r-- 1 phil phil 12K jui 18 18:14 INSTALL -rwxr-xr-x 1 phil phil 14K jui 18 18:14 install-sh -rw-r--r-- 1 phil phil 20K jui 18 18:14 Makefile -rw-r--r-- 1 phil phil 12 jui 16 20:57 Makefile.am -rw-r--r-- 1 phil phil 19K jui 19 08:39 Makefile.in -rwxr-xr-x 1 phil phil 11K jui 18 18:14 missing -rw-r--r-- 1 phil phil 0 jui 16 21:08 NEWS -rw-r--r-- 1 phil phil 0 jui 16 21:08 README drwxr-xr-x 3 phil phil 4,0K jui 19 08:39 src

Dans le répertoire src se trouvent donc mes sources et plus précisemment :

phil@laptop-ph:~/workspace/gaffer$ ls -lah src/ total 792K drwxr-xr-x 3 phil phil 4,0K jui 19 08:39 . drwxr-xr-x 4 phil phil 4,0K jui 19 08:54 .. drwxr-xr-x 2 phil phil 4,0K jui 18 18:14 .deps -rw-r--r-- 1 phil phil 5,0K jui 18 14:58 fgaffer.cpp -rw-r--r-- 1 phil phil 1,6K jui 18 14:54 fgaffer.h -rw-r--r-- 1 phil phil 172K jui 18 18:14 fgaffer.o -rwxr-xr-x 1 phil phil 261K jui 18 18:14 gaffer -rw-r--r-- 1 phil phil 37K jui 18 14:50 gaffer.svg -rw-r--r-- 1 phil phil 1,3K jui 18 17:59 main.cpp -rw-r--r-- 1 phil phil 73K jui 18 18:14 main.o -rw-r--r-- 1 phil phil 15K jui 18 18:14 Makefile -rw-r--r-- 1 phil phil 412 jui 18 17:37 Makefile.am -rw-r--r-- 1 phil phil 14K jui 19 08:39 Makefile.in -rw-r--r-- 1 phil phil 1,1K jui 18 15:02 note.cpp -rw-r--r-- 1 phil phil 1004 jui 18 15:01 note.h -rw-r--r-- 1 phil phil 88K jui 18 18:14 note.o -rw-r--r-- 1 phil phil 447 jui 18 14:50 parametres.cpp -rw-r--r-- 1 phil phil 404 jui 18 14:50 parametres.h -rw-r--r-- 1 phil phil 50K jui 18 18:14 parametres.o

J’ai fais comme ceci (dans l’ordre) :

[code]$ autoscan

Renommage de configure.scan en configure.ac, je vous l’affiche ensuite

$ aclocal
$ autoconf
$ automake -a -c[/code]

Pour toutes ces opérations, je n’ai aucun retour dans le terminal, ça semble se passer très bien. Par contre, la suite est moins glorieuse…

Voici ce que me retourne ./configure

[code]phil@laptop-ph:~/workspace/gaffer$ ./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… /bin/mkdir -p
checking for gawk… no
checking for mawk… mawk
checking whether make sets $(MAKE)… yes
checking for g++… g++
checking for C++ compiler default output file name… a.out
checking whether the C++ compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C++ compiler… yes
checking whether g++ accepts -g… yes
checking for style of include used by make… GNU
checking dependency style of g++… gcc3
checking for gcc… gcc
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 dependency style of gcc… gcc3
checking how to run the C preprocessor… gcc -E
checking for grep that handles long lines and -e… /bin/grep
checking for egrep… /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 for stdlib.h… (cached) yes
checking for stdbool.h that conforms to C99… yes
checking for _Bool… yes
checking for pkg-config… /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0… yes
checking for GAFFER… configure: error: Package requirements (gtkmm-2.4 >= 2.8) were not met:

No package ‘gtkmm-2.4’ found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables GAFFER_CFLAGS
and GAFFER_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
[/code]

Aïe :S Mes Makefile ne sont donc pas générés… (ceux des ls en haut proviennent de précédents appels aux autotools, sur une Ubuntu où cela fonctionnait un peu mieux ^^).

Je vous affiche donc mes fichiers configure.ac et mes Makefile.am !

configure.ac

[code]# -- Autoconf --

Process this file with autoconf to produce a configure script.

AC_PREREQ([2.63])
AC_INIT(gaffer, 0.1, plop@plop.fr)
AM_INIT_AUTOMAKE

Checks for programs.

AC_PROG_CXX
AC_PROG_CC

Checks for libraries.

Checks for header files.

AC_CHECK_HEADERS([stdlib.h])

Checks for typedefs, structures, and compiler characteristics.

AC_HEADER_STDBOOL

Checks for library functions.

PKG_CHECK_MODULES(GAFFER, [gtkmm-2.4 >= 2.8])
AC_SUBST(GAFFER_CFLAGS)
AC_SUBST(GAFFER_LIBS)

AC_CONFIG_FILES([Makefile
src/Makefile])
AC_OUTPUT
[/code]

Makefile.am

SUBDIRS=src

src/Makefile.am

[code]INCLUDES =
-DPACKAGE_LOCALE_DIR=""$(prefix)/$(DATADIRNAME)/locale""
-DPACKAGE_SRC_DIR=""$(srcdir)""
-DPACKAGE_DATA_DIR=""$(datadir)""
$(GAFFER_CFLAGS)
-I/usr/include/gtkmm-2.4

AM_CFLAGS =
-Wall
-g

bin_PROGRAMS=gaffer

gaffer_SOURCES=
main.cpp
fgaffer.cpp fgaffer.h
note.cpp note.h
parametres.cpp parametres.h

gaffer_LDFLAGS =
gaffer_LDADD = $(GAFFER_LIBS)
[/code]

J’ai pourtant tenté l’installation des librairies gtkmm (je suis encore inhabitué de la chose) et notamment les paquets suivants : libgtkmm-2.4-1c2a libgtkmm-2.4-dev build-essentiels

$ locate gtkmm.h ne me retourne toujours rien :’(

Me suis-je planté quelque part ? Notamment dans le choix des paquets à installer ? Merci d’avoir lu la description de mon problème :slightly_smiling:

Il me manquait le paquet libgtkmm-2.4-dev. Je disais pourtant le contraire à l’époque du post… Je ne sais pas trop ce que j’ai fait mais mon problème est résolu.