Re: [Anjuta-list] help



Hi,

Moises a écrit :
Thank to all for your comments, but I still have the
same problem, I am using ubuntu 7.10 and anjuta 2.2.0,
and try to create a new project of gtk + with autogen:
the code is the next:

Have you used the project-wizard to create your project ? Normally, the project wizard should create all needed files.

Then, the building of your program is not really handled by Anjuta which just run make. Anjuta expects that your project use the standard autotool setup, so you can exit from Anjuta and check that you can build your program from the command line.

So you need to write yourself:
	- configure.in in the top directory
	- Makefile.am in each directory of your project
	- All your source files.

Then, you need to run configure or autogen.sh in the top directory of your project. If you have it, autogen.sh is better because it takes care of more things.

You get a problem probably in this step perhaps because something is missing. Normally when a library is missing you should have a meaningful error message but it's not always the case.

You can check that you have at least installed automake, autotool, gnome-common (I don't know its name on Ubuntu, but on my distribution I have a package grouping all gnome development utilities).
Then, this step should create all make files from the Makefile.am.

Typically, in order to find gtk header, you need to pass something like -I/usr/include/gtk-2.0, so in the generated Makefile you need to find a variable named *_CFLAGS including this string.

If you have this variable, try to find why it is not used when you compile your file. It's a bit difficult to track as automake generated a lots of variables but it's possible by example, I have here

GNOME_UI_CFLAGS = -DORBIT2=1 -pthread -I/usr/include/libgnomeui-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-keyring-1 -I/usr/include/libgnome-2.0 -I/usr/include/libbonoboui-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gtk-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libxml2 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/gail-1.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/libpng12

INCLUDES = \
        $(WARN_CFLAGS) \
        $(DEPRECATED_FLAGS) \
        $(GNOME_UI_CFLAGS) \
        $(GLADE_CFLAGS) \
        $(LIBXML_CFLAGS) \
        $(GNOMEVFS_CFAGS) \
        -I$(top_srcdir) \
        -DPACKAGE_PIXMAPS_DIR="\"$(datadir)/pixmaps/$(PACKAGE)\"" \
        -DPACKAGE_DATA_DIR="\"$(datadir)/$(PACKAGE)\"" \
        -DPACKAGE_HELP_DIR="\"$(datadir)/gnome/help/$(PACKAGE)\"" \
        -DPACKAGE_DOC_DIR="\"$(datadir)/doc/$(PACKAGE)\"" \
        -DPACKAGE_DATA_DIR="\"$(datadir)/$(PACKAGE)\"" \
        -DG_LOG_DOMAIN=\"libanjuta\"

COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)

.c.o:
        $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
        mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po

So, I see that in GNOME_UI_CFLAGS, I have "-I/usr/include/gtk-2.0" and I can see that when I compile a .o file into a .c this string is passed (with a lots of other strings) to the C compiler. If you have problem here, you need to fix the Makefile.am file.


If you don't have this string, it means that the configure script has not detected correctly the gtk library. In this case, the error is rather in the configure.in file. You need to write somewhere that you will use gtk library, it looks like
PKG_CHECK_MODULES(PACKAGE, [gtk+-2.0])
AC_SUBST(PACKAGE_CFLAGS)
AC_SUBST(PACKAGE_LIBS)

This PKG_CHECK_MODULES macros is using pkg-config to get all needed compiler flags, so it needs to work. But apparently in your case it's ok.

Regards,

Sébastien




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]