Re: [Anjuta-list] Re: Help compiling a GTK-- test program



>1) I have the same problem here with a gtk-- test project from the
> wizard... using 0.17 on debian (unstable) with gtk-- 1.2.8 installed and
> functioning correctly.
>
> I selected "C++ only" in the wizard, I have support for "C++ bindings for
> gtk" turned on in the compiler options, and my compiler commands show:
>
> Compile: g++ $(anjuta.compiler.flags) -c $(current.file.name.ext) -o
> $(current.file.name).o `gtkmm-config --cflags --libs` Build: g++
> $(anjuta.compiler.flags) $(anjuta.linker.flags) $(current.file.name.ext) -o
> $(current.file.name) `gtkmm-config --cflags --libs`
>
> This should work, I think?
>
> However, when I compile, I see the following:
>
> 	C++ DHAVE_CONFIG_H -I. -I. -I.. `gtkmm-config --cflags` <snip other flags>
> -c test.cc C++ DHAVE_CONFIG_H -I. -I. -I.. `gtkmm-config --cflags` <snip
> other flags> -c window1.cc C++ DHAVE_CONFIG_H -I. -I. -I.. `gtkmm-config
> --cflags` <snip other flags> -c window1_glade.cc
>
> and a whole load of build errors. Seems to me that anjuta is not passing
> the "--libs" flags to the compiler. How do I sort this?
>
> -----------
> 2) When I traverse into the project src directory, and try to compile by
> hand with:
>
> 	g++ test.cc -o test `gtkmm-config --cflags --libs`
>
> I get the error:
>
> 	test.cc:8: config.h: No such file or directory
>
> The corresponding line in test.cc is:
>
> 	#include <config.h>
>
> At this point, I should come clean and admit that I am just begining to
> learn how to program / debug...  I've checked /usr/include and can't find
> "config.h"... so I took a guess that it means the "config.h" in the project
> directory. I hard coded this and tried again, only to get the same errors
> as the previous poster:
>
> /tmp/cchB7mva.o: In function `main':
> /tmp/cchB7mva.o(.text+0x4d): undefined reference to `Gnome::Main::Main(int,
> basic_string<char, string_char_traits<char>, __default_alloc_template<true,
> 0> > const &, basic_string<char, string_char_traits<char>,
> __default_alloc_template<true, 0> > const &, int, char **)'
>
> and so on...



Hi,

 Ok, first time I have found some intermediate solution that consist of 
injecting :
   `gtkmm-config --libs`  `gnome-config gnomemm` in the 118th line of 
/src/Makefile :
............................
............................ 
DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I..
CPPFLAGS =
LDFLAGS =
LIBS = `gtkmm-config --libs` `gnome-config gnomemm`
YOURPROJECTXXXX_OBJECTS =  YOURPROJECTXXXX.o window1.o window1_glade.o
YOURPROJECTXXXX_DEPENDENCIES =
YOURPROJECTXXXX_LDFLAGS =
............................
............................

But there is another way to get your gtk- project compiled : just download 
the anjutacvs tar file it works really fine. And then it's a pleasure to code 
using anjuta.

Next question :
 If you you want to write a pure gtk- application, just rewrite the file 
source containing the main function by inserting GTK::Main instead of the 
Gnome one. Don't forget to change your headers by using only gtk--/........

I hope that my answers will help you... 

Regards,

A. Bouanan

Btw : i'm using gtkmm-1.2.8 and gnomemm-1.2.2





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