Errors building gtkmm 2.12.7 with Visual Studio 2008 (Visual C++ 9.0, vc9)



Hi all,

I have tried to build gtkmm with MS Visual C++ 9.0 (vc9, Visual Studio 2008). I am using the Visual Studio 2008 Team System Development Edition (behavior similar to the Standard Edition or better for this purpose), but without success! There were several smaller problems until I have come to this stage. It should build out of the box (no errors, no warnings).

There are errors during linking phase when building the gtkmm-2.4 project:

------ Build started: Project: gtkmm-2.4, Configuration: Release Win32 ------
Generate gtkmm def file
Microsoft (R) COFF/PE Dumper Version 9.00.21022.08
Copyright (C) Microsoft Corporation.  All rights reserved.
dumpbin /SYMBOLS /OUT:dumpbin.out Release\*.obj
Linking...
   Creating library Release\gtkmm-2.4.lib and object Release\gtkmm-2.4.exp
widget.obj : error LNK2019: unresolved external symbol "class Glib::RefPtr<class Gtk::Tooltip> __cdecl Glib::wrap(struct _GtkTooltip *,bool)" (?wrap Glib@@YA?AV?$RefPtr VTooltip@Gtk@@@1 PAU_GtkTooltip@@_N Z) referenced in function "int __cdecl `anonymous namespace'::Widget_signal_query_tooltip_callback(struct _GtkWidget *,int,int,int,struct _GtkTooltip *,void *)" (?Widget_signal_query_tooltip_callback ?A0xeade9253@@YAHPAU_GtkWidget@@HHHPAU_GtkTooltip@@PAX Z)
wrap_init.obj : error LNK2019: unresolved external symbol "public: static unsigned long __cdecl Gtk::VolumeButton::get_type(void)" (?get_type VolumeButton@Gtk@@SAKXZ) referenced in function "void __cdecl Gtk::wrap_init(void)" (?wrap_init Gtk@@YAXXZ)
wrap_init.obj : error LNK2019: unresolved external symbol "public: static unsigned long __cdecl Gtk::Tooltip::get_type(void)" (?get_type Tooltip@Gtk@@SAKXZ) referenced in function "void __cdecl Gtk::wrap_init(void)" (?wrap_init Gtk@@YAXXZ)
wrap_init.obj : error LNK2019: unresolved external symbol "public: static unsigned long __cdecl Gtk::ScaleButton::get_type(void)" (?get_type ScaleButton@Gtk@@SAKXZ) referenced in function "void __cdecl Gtk::wrap_init(void)" (?wrap_init Gtk@@YAXXZ)
wrap_init.obj : error LNK2019: unresolved external symbol "public: static unsigned long __cdecl Gtk::RecentAction::get_type(void)" (?get_type RecentAction@Gtk@@SAKXZ) referenced in function "void __cdecl Gtk::wrap_init(void)" (?wrap_init Gtk@@YAXXZ)
wrap_init.obj : error LNK2019: unresolved external symbol "public: static unsigned long __cdecl Gtk::Builder::get_type(void)" (?get_type Builder@Gtk@@SAKXZ) referenced in function "void __cdecl Gtk::wrap_init(void)" (?wrap_init Gtk@@YAXXZ)
wrap_init.obj : error LNK2019: unresolved external symbol "public: static class Glib::ObjectBase * __cdecl Gtk::VolumeButton_Class::wrap_new(struct _GObject *)" (?wrap_new VolumeButton_Class@Gtk@@SAPAVObjectBase Glib@@PAU_GObject@@@Z) referenced in function "void __cdecl Gtk::wrap_init(void)" (?wrap_init Gtk@@YAXXZ)
wrap_init.obj : error LNK2019: unresolved external symbol "public: static class Glib::ObjectBase * __cdecl Gtk::Tooltip_Class::wrap_new(struct _GObject *)" (?wrap_new Tooltip_Class@Gtk@@SAPAVObjectBase Glib@@PAU_GObject@@@Z) referenced in function "void __cdecl Gtk::wrap_init(void)" (?wrap_init Gtk@@YAXXZ)
wrap_init.obj : error LNK2019: unresolved external symbol "public: static class Glib::ObjectBase * __cdecl Gtk::ScaleButton_Class::wrap_new(struct _GObject *)" (?wrap_new ScaleButton_Class@Gtk@@SAPAVObjectBase Glib@@PAU_GObject@@@Z) referenced in function "void __cdecl Gtk::wrap_init(void)" (?wrap_init Gtk@@YAXXZ)
wrap_init.obj : error LNK2019: unresolved external symbol "public: static class Glib::ObjectBase * __cdecl Gtk::RecentAction_Class::wrap_new(struct _GObject *)" (?wrap_new RecentAction_Class@Gtk@@SAPAVObjectBase Glib@@PAU_GObject@@@Z) referenced in function "void __cdecl Gtk::wrap_init(void)" (?wrap_init Gtk@@YAXXZ)
wrap_init.obj : error LNK2019: unresolved external symbol "public: static class Glib::ObjectBase * __cdecl Gtk::Builder_Class::wrap_new(struct _GObject *)" (?wrap_new Builder_Class@Gtk@@SAPAVObjectBase Glib@@PAU_GObject@@@Z) referenced in function "void __cdecl Gtk::wrap_init(void)" (?wrap_init Gtk@@YAXXZ)
wrap_init.obj : error LNK2019: unresolved external symbol "private: static void __cdecl Gtk::BuilderError::throw_func(struct _GError *)" (?throw_func BuilderError@Gtk@@CAXPAU_GError@@@Z) referenced in function "void __cdecl Gtk::wrap_init(void)" (?wrap_init Gtk@@YAXXZ)
Release\gtkmm-2.4.dll : fatal error LNK1120: 12 unresolved externals
Build log was saved at "file://g:\cots\gtk\gtkmm-2.12.7\MSVC_Net2003\gtkmm\Release\BuildLog.htm"
gtkmm-2.4 - 13 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

It does not help to use Service Pack 1, the same error messages appear.

I have used the following components:

from gladewin32 (http://sourceforge.net/projects/gladewin32)
gtk-dev-2.12.9-win32-2.exe

cairo.lib is missing, thus I updated my installation:

from GNOME (http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.14/)
gtk+-bundle_2.14.1-20080905-1_win32.zip

Then I downloaded the following C++ components (sources):

http://cairographics.org/releases/cairomm-1.6.4.tar.gz
http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.0/libsigc++-2.0.18.tar.bz2
http://ftp.gnome.org/pub/GNOME/sources/glibmm/2.16/glibmm-2.16.4.tar.bz2
http://ftp.gnome.org/pub/GNOME/sources/gtkmm/2.12/gtkmm-2.12.7.tar.bz2

I built a structure inside the GTK/ directory from the C component installation, derived from the C++ library DLL names (stripping the suffix). It was tedious work to add the necessary make support: for each used component 2 include directories and 1 import library directory. This is very time consuming, maybe we need a new build system for GNOME so that the Windows platform can be supported better (GNU Build System is not suitable for that and not easy to master). A one-click build would be helpful. A one-library approach which QT uses would reduce the requirements on the build system (for desktop systems at least, embedded systems need a component selector). I identify the build support as the main issue with gtk+/gtkmm which inhibits widespread adoption.

I had to change the code to get it to compile and link:

In the resource files of all projects, I commented out:
#include "resource.h"
which cannot be found on my system. Is it necessary for older Visual Studio compilers or the Express version? Then it should have a guard if possible, or a separate resource file. A no errors, no warnings build should be possible.

I need to add keyfile.{cc,h} and regex.{cc,h} to the glibmm project. This is fixed with glibmm 2.17.3, maybe it can be backported.

Then I did for each component:
- import and update the solution (.sln) file (as said, I use vs2008)
- build release version of the library only
- copy the results into the GTK installation directory

I began with sigc++ which is required by the other components.

I offer my help in sorting out the build problems on this widespread development platform (Visual Studio). The APIs are very good, and gtkmm deserves a more widespread adoption as a multi-platform GUI solution. Many people only know about JAVA and QT at the moment.

-- 
André Heynatz


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