Re: Compiling with Eclipse
- From: martu <martu_xd gmx de>
- To: gtkmm-list gnome org
- Subject: Re: Compiling with Eclipse
- Date: Wed, 11 Jul 2012 18:01:03 +0200
For me it works with:
project-properties->C/C++ Build->Settings->Tool Settings
under GCC C++ Compiler->Miscellaneous in the "other flags" field put/append `pkg-config gtkmm-2.4 --cflags`
and under GCC C++ Compiler->Includes add the path to the gtkmm include dir (/usr/include/gtkmm-2.4 for me). I don't know if this is necessary because of the pkg-config but it works for me.
And for the linker
in GCC C++ Linker->Miscellaneous in the "Linker flags" field put `pkg-config gtkmm-2.4 --libs`.
When building the command line should look like:
g++ -I/usr/include/gtkmm-2.4 -O0 -g3 -Wall -c -fmessage-length=0 `pkg-config gtkmm-2.4 --cflags` -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.cpp"
and the linking stage:
g++ `pkg-config gtkmm-2.4 --libs` -o"testing" ./main.o
Hope this helps.
(For solution with cmake and integratiing cmake with eclipse see my other more lengthy mail)
On Tue, 10 Jul 2012 19:28:16 -0300
Rodrigo Nunes <rnsribeiro gmail com> wrote:
> I'm trying to compile a simple program, has set up the eclipse as in this
> tutorial:
> http://kapo-cpp.blogspot.com.br/2008/01/using-eclipse-for-your-gtkmm-project.html
>
> I'm using gtkmm-3.0.
>
> gtkmmdemo.cc
> ------------------------------------------
> #include <gtkmm.h>
>
> int main(int argc, char *argv[])
> {
> Gtk::Main kit(argc, argv);
>
> Gtk::Window window;
>
> Gtk::Main::run(window);
>
> return 0;
> }
> --------------------------------------------
>
> And the error message I get is this:
> --------------------------------------------------------------
> **** Build of configuration Debug for project gtkmmdemo ****
>
> make all
> Building file: ../src/gtkmmdemo.cc
> Invoking: GCC C++ Compiler
> g++ -I/usr/include/gtkmm-3.0 -I/usr/include/glibmm-2.4
> -I/usr/lib/gtkmm-3.0/include -I/usr/include/atkmm-1.6
> -I/usr/include/giomm-2.4 -I/usr/lib/i386-linux-gnu/giomm-2.4/include
> -I/usr/include/pangomm-1.4 -I/usr/lib/i386-linux-gnu/pangomm-1.4/include
> -I/usr/include/gtk-3.0 -I/usr/include/cairomm-1.0
> -I/usr/lib/i386-linux-gnu/cairomm-1.0/include -I/usr/include/gdk-pixbuf-2.0
> -I/usr/include/gtk-3.0/unix-print -I/usr/include/atk-1.0
> -I/usr/lib/i386-linux-gnu/glibmm-2.4/include -I/usr/include/glib-2.0
> -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/sigc++-2.0
> -I/usr/lib/i386-linux-gnu/sigc++-2.0/include -I/usr/include/pango-1.0
> -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2
> -I/usr/include/libpng12 -I/usr/include/gio-unix-2.0
> -I/usr/include/gdkmm-3.0 -I/usr/lib/gdkmm-3.0/include -O0 -g3 -Wall -c
> -fmessage-length=0 -MMD -MP -MF"src/gtkmmdemo.d" -MT"src/gtkmmdemo.d" -o
> "src/gtkmmdemo.o" "../src/gtkmmdemo.cc"
> Finished building: ../src/gtkmmdemo.cc
>
> Building target: gtkmmdemo
> Invoking: GCC C++ Linker
> g++ `pkg-config gtkmm-3.0 --libs --cflags` -o "gtkmmdemo"
> ./src/gtkmmdemo.o
> ./src/gtkmmdemo.o: In function `main':
> /home/rodrigo/workspace/gtkmm/gtkmmdemo/Debug/../src/gtkmmdemo.cc:5:
> undefined reference to `Gtk::Main::Main(int&, char**&, bool)'
> /home/rodrigo/workspace/gtkmm/gtkmmdemo/Debug/../src/gtkmmdemo.cc:7:
> undefined reference to `Gtk::Window::Window(Gtk::WindowType)'
> /home/rodrigo/workspace/gtkmm/gtkmmdemo/Debug/../src/gtkmmdemo.cc:9:
> undefined reference to `Gtk::Main::run(Gtk::Window&)'
> /home/rodrigo/workspace/gtkmm/gtkmmdemo/Debug/../src/gtkmmdemo.cc:11:
> undefined reference to `Gtk::Window::~Window()'
> /home/rodrigo/workspace/gtkmm/gtkmmdemo/Debug/../src/gtkmmdemo.cc:11:
> undefined reference to `Gtk::Main::~Main()'
> /home/rodrigo/workspace/gtkmm/gtkmmdemo/Debug/../src/gtkmmdemo.cc:11:
> undefined reference to `Gtk::Window::~Window()'
> /home/rodrigo/workspace/gtkmm/gtkmmdemo/Debug/../src/gtkmmdemo.cc:11:
> undefined reference to `Gtk::Main::~Main()'
> ./src/gtkmmdemo.o: In function `__static_initialization_and_destruction_0':
> /usr/include/gtkmm-3.0/gtkmm/papersize.h:45: undefined reference to
> `Glib::ustring::ustring(char const*)'
> /usr/include/gtkmm-3.0/gtkmm/papersize.h:45: undefined reference to
> `Glib::ustring::~ustring()'
> /usr/include/gtkmm-3.0/gtkmm/papersize.h:46: undefined reference to
> `Glib::ustring::ustring(char const*)'
> /usr/include/gtkmm-3.0/gtkmm/papersize.h:46: undefined reference to
> `Glib::ustring::~ustring()'
> /usr/include/gtkmm-3.0/gtkmm/papersize.h:47: undefined reference to
> `Glib::ustring::ustring(char const*)'
> /usr/include/gtkmm-3.0/gtkmm/papersize.h:47: undefined reference to
> `Glib::ustring::~ustring()'
> /usr/include/gtkmm-3.0/gtkmm/papersize.h:48: undefined reference to
> `Glib::ustring::ustring(char const*)'
> /usr/include/gtkmm-3.0/gtkmm/papersize.h:48: undefined reference to
> `Glib::ustring::~ustring()'
> /usr/include/gtkmm-3.0/gtkmm/papersize.h:49: undefined reference to
> `Glib::ustring::ustring(char const*)'
> /usr/include/gtkmm-3.0/gtkmm/papersize.h:49: undefined reference to
> `Glib::ustring::~ustring()'
> /usr/include/gtkmm-3.0/gtkmm/papersize.h:50: undefined reference to
> `Glib::ustring::ustring(char const*)'
> /usr/include/gtkmm-3.0/gtkmm/papersize.h:50: undefined reference to
> `Glib::ustring::~ustring()'
> /usr/include/gtkmm-3.0/gtkmm/papersize.h:51: undefined reference to
> `Glib::ustring::ustring(char const*)'
> /usr/include/gtkmm-3.0/gtkmm/papersize.h:51: undefined reference to
> `Glib::ustring::~ustring()'
> collect2: ld returned 1 exit status
> make: *** [gtkmmdemo] Error 1
>
> **** Build Finished ****
> -----------------------------------------------------------------------------------------------------------------------------------
>
> Does anyone know how to fix this?
>
>
> --
> Pensamentos viram palavras,
> Palavras viram ações,
> Ações viram hábitos,
> Hábitos viram caráter,
> E o caráter vira o seu destino.
--
martu <martu_xd gmx de>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]