Undefined references



Hi all,

I am trying to compile the example from the gtkmm tutorial without success.
I am using Windows XP with eclipse and MinGW.
I installed gtkmm using the latest installer available at
http://live.gnome.org/gtkmm/MSWindows (2.16.0-2).
I added all the includes and libs specified by pkg-config to the
project configuration, but I still get undefined references at linking
time.
Please, help!

These are the contents of the file I'm trying to compile (src/gtk_test.cpp):

#include <iostream>
#include <gtkmm.h>
using namespace std;
int main(int argc, char *argv[]) {
        Gtk::Main kit(argc, argv);
        Gtk::Window window;
        Gtk::Main::run(window);
        return 0;
}


This is the output from the eclipse console (you can see the includes
and libs being added there):

**** Build of configuration Debug for project gtk_test ****
**** Internal Builder is used for build               ****
g++ -IC:\libs\gtkmm\include\gtkmm-2.4 -O0 -g3 -Wall -c
-fmessage-length=0 -mms-bitfields -IC:/libs/gtkmm/include/gtkmm-2.4
-IC:/libs/gtkmm/lib/gtkmm-2.4/include
-IC:/libs/gtkmm/include/glibmm-2.4
-IC:/libs/gtkmm/lib/glibmm-2.4/include
-IC:/libs/gtkmm/include/giomm-2.4
-IC:/libs/gtkmm/lib/giomm-2.4/include
-IC:/libs/gtkmm/include/gdkmm-2.4
-IC:/libs/gtkmm/lib/gdkmm-2.4/include
-IC:/libs/gtkmm/include/pangomm-1.4 -IC:/libs/gtkmm/include/atkmm-1.6
-IC:/libs/gtkmm/include/gtk-2.0 -IC:/libs/gtkmm/include/sigc++-2.0
-IC:/libs/gtkmm/lib/sigc++-2.0/include
-IC:/libs/gtkmm/include/glib-2.0 -IC:/libs/gtkmm/lib/glib-2.0/include
-IC:/libs/gtkmm/lib/gtk-2.0/include
-IC:/libs/gtkmm/include/cairomm-1.0 -IC:/libs/gtkmm/include/pango-1.0
-IC:/libs/gtkmm/include/cairo -IC:/libs/gtkmm/include/atk-1.0
-osrc\gtk_test.o ..\src\gtk_test.cpp
g++ -LC:/libs/gtkmm/lib -lgtkmm-2.4 -lgiomm-2.4 -lgdkmm-2.4
-latkmm-1.6 -lgtk-win32-2.0 -lpangomm-1.4 -lcairomm-1.0 -lglibmm-2.4
-lsigc-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0
-lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo
-lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -ogtk_test.exe
src\gtk_test.o
src\gtk_test.o: In function `main':
C:/Documents and Settings/plr/My
Documents/workspace/gtk_test/Debug/../src/gtk_test.cpp:5: undefined
reference to `Gtk::Main::Main(int&, char**&, bool)'
C:/Documents and Settings/plr/My
Documents/workspace/gtk_test/Debug/../src/gtk_test.cpp:6: undefined
reference to `Gtk::Window::Window(Gtk::WindowType)'
C:/Documents and Settings/plr/My
Documents/workspace/gtk_test/Debug/../src/gtk_test.cpp:7: undefined
reference to `Gtk::Main::run(Gtk::Window&)'
C:/Documents and Settings/plr/My
Documents/workspace/gtk_test/Debug/../src/gtk_test.cpp:8: undefined
reference to `Gtk::Window::~Window()'
C:/Documents and Settings/plr/My
Documents/workspace/gtk_test/Debug/../src/gtk_test.cpp:8: undefined
reference to `Gtk::Main::~Main()'
C:/Documents and Settings/plr/My
Documents/workspace/gtk_test/Debug/../src/gtk_test.cpp:8: undefined
reference to `Gtk::Window::~Window()'
C:/Documents and Settings/plr/My
Documents/workspace/gtk_test/Debug/../src/gtk_test.cpp:8: undefined
reference to `Gtk::Main::~Main()'
src\gtk_test.o: In function `Z41__static_initialization_and_destruction_0ii':
C:/libs/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:37: undefined
reference to `Glib::ustring::ustring(char const*)'
C:/libs/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:38: undefined
reference to `Glib::ustring::ustring(char const*)'
C:/libs/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:39: undefined
reference to `Glib::ustring::ustring(char const*)'
C:/libs/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:40: undefined
reference to `Glib::ustring::ustring(char const*)'
C:/libs/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:41: undefined
reference to `Glib::ustring::ustring(char const*)'
src\gtk_test.o:C:/libs/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:42:
more undefined references to `Glib::ustring::ustring(char const*)'
follow
src\gtk_test.o: In function `Z41__static_initialization_and_destruction_0ii':
C:/libs/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:43: undefined
reference to `Glib::ustring::~ustring()'
C:/libs/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:42: undefined
reference to `Glib::ustring::~ustring()'
C:/libs/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:41: undefined
reference to `Glib::ustring::~ustring()'
C:/libs/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:40: undefined
reference to `Glib::ustring::~ustring()'
C:/libs/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:39: undefined
reference to `Glib::ustring::~ustring()'
src\gtk_test.o:C:/libs/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:38:
more undefined references to `Glib::ustring::~ustring()' follow
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 12391  ms.


Just in case, this is the version of gcc I am using:
C:\Documents and Settings\plr>\MinGW\bin\g++.exe --version
g++.exe (GCC) 3.4.5 (mingw-vista special r3)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanks in advance

-- 
[]'s
Pedro
http://www.cs.nott.ac.uk/~plr/
 /\  ASCII Ribbon
 \/  Campaign against
 /\  HTML e-mail
/  \


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