Toralf Lund wrote: > I'm now trying to build gtkmm 2.6.5 via g++ set up as cross compiler > with i386-mingw32 output (now that I've got 2.2.12 to work after > tweaking a bit - I want to support 2.0 *and* 2.4 APIs.) Unfortunately, I > get the problem described in > http://bugzilla.gnome.org/show_bug.cgi?id=309030 - despite the fact that > 2.6.5 is supposed to contain a fix for that. It seems like the problem > is that the GTKMM_API will *not* contain "__declspec(dllimport)" because > that setup is conditial on GLIBMM_DLL, which won't be defined in my > glibmm setup (version 2.6.1 built in a similar manner.) The problem is > the following section of glibmmconfig.h: > > // detect common platforms > #if defined(_WIN32) > // Win32 compilers have a lot of varation > #if defined(_MSC_VER) > #define GLIBMM_MSC > #define GLIBMM_WIN32 > #define GLIBMM_DLL > #elif defined(__CYGWIN__) > #define GLIBMM_CONFIGURE > #elif defined(__MINGW32__) > #define GLIBMM_WIN32 > #define GLIBMM_CONFIGURE > #else > > - notice how GLIBMM_DLL won't be defined in the "MinGW" case. I tried to > rebuild glibmm after inserting
Defining GLIBMM_DLL (hence __declspec(dllimport/dllexport)) is not required as all symbols are exported at link time when using the -Wl,--export-all-symbols option. Now, another important option to use at link time is -no-undefined (see build_shared/Makefile_build.am_fragment) and I don't see it in your g++ command line options. As this option is automatically added to LDFLAGS at configure time when the host is either *-mingw32-* or *-cygwin-*, I guess something you did not use the --host=i686-pc-mingw32 option with configure or there is an error in the configure.in file. Anyway, either try again with --host=i686-pc-mingw32 or manually add -no-undefined to LDFLAGS in glib/glibmm/Makefile. It if still fails, you should give us the release of gcc that you use (I don't know if DLL auto-import works for mingw32 with the 4.x releases). Cedric > > #define GLIBMM_DLL > > at the appropriate spot, but then I got > > i386-mingw32-g++ -shared -nostdlib > /usr/lib/gcc/i386-mingw32/3.4.6/../../../../i386-mingw32/lib/dllcrt2.o > .libs/convert.o .libs/date.o .libs/fileutils.o .libs/iochannel.o > .libs/markup.o .libs/module.o .libs/optioncontext.o .libs/optionentry.o > .libs/optiongroup.o .libs/shell.o .libs/spawn.o .libs/thread.o > .libs/unicode.o .libs/wrap_init.o .libs/value_basictypes.o .libs/class.o > .libs/containers.o .libs/debug.o .libs/dispatcher.o .libs/error.o > .libs/exception.o .libs/exceptionhandler.o .libs/init.o > .libs/interface.o .libs/main.o .libs/miscutils.o .libs/object.o > .libs/objectbase.o .libs/pattern.o .libs/property.o > .libs/propertyproxy.o .libs/propertyproxy_base.o .libs/quark.o > .libs/random.o .libs/signalproxy.o .libs/signalproxy_connectionnode.o > .libs/streamiochannel.o .libs/stringutils.o .libs/threadpool.o > .libs/timer.o .libs/timeval.o .libs/ustring.o .libs/utility.o > .libs/value.o .libs/value_custom.o .libs/wrap.o -L/usr/i386-mingw32/lib > /usr/i386-mingw32/lib/libsigc-2.0.dll.a -lgobject-2.0 -lgmodule-2.0 > -lglib-2.0 -lintl -liconv -L/usr/lib/gcc/i386-mingw32/3.4.6 > -L/usr/lib/gcc/i386-mingw32/3.4.6/../../../../i386-mingw32/lib -lstdc++ > -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 > -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt > -mms-bitfields -Wl,--export-all-symbols -o .libs/libglibmm-2.4-1.dll > -Wl,--image-base=0x10000000 -Wl,--out-implib,.libs/libglibmm-2.4.dll.a > Creating library file: .libs/libglibmm-2.4.dll.a > .libs/objectbase.o(.text+0x163): In function `ZN4Glib10ObjectBaseD2Ev': > /usr/src/redhat/BUILD/glibmm-2.6.1/glib/glibmm/objectbase.cc:120: > d reference to `_imp___ZN4Glib6quark_E' > .libs/objectbase.o(.text+0x211): In function `ZN4Glib10ObjectBaseD1Ev': > /usr/src/redhat/BUILD/glibmm-2.6.1/glib/glibmm/objectbase.cc:120: > undefined reference to `_imp___ZN4Glib6quark_E' > .libs/objectbase.o(.text+0x2ed): In function `ZN4Glib10ObjectBaseD0Ev': > /usr/src/redhat/BUILD/glibmm-2.6.1/glib/glibmm/objectbase.cc:120: > undefined reference to `_imp___ZN4Glib6quark_E' > .libs/objectbase.o(.text+0x3c4): In function > `ZN4Glib10ObjectBase20_set_current_wrapperEP8_GObject': > /usr/src/redhat/BUILD/glibmm-2.6.1/glib/glibmm/objectbase.cc:157: > undefined reference to `_imp___ZN4Glib6quark_E' > .libs/objectbase.o(.text+0x3e0):/usr/src/redhat/BUILD/glibmm-2.6.1/glib/glibmm/objectbase.cc:159: > undefined reference to `_imp___ZN4Glib6quark_E' > .libs/objectbase.o(.text+0x48b):/usr/src/redhat/BUILD/glibmm-2.6.1/glib/glibmm/objectbase.cc:174: > more undefined references to `_imp___ZN4Glib6quark_E' follow > .libs/objectbase.o(.text+0x58b): In function > `ZN4Glib36_gobject_cppinstance_already_deletedEP8_GObject': > /usr/src/redhat/BUILD/glibmm-2.6.1/glib/glibmm/objectbase.cc:264: > undefined reference to `_imp___ZN4Glib26quark_cpp_wrapper_deleted_E' > .libs/wrap.o(.text+0x1b): In function > `ZNSt6vectorIPFPN4Glib10ObjectBaseEP8_GObjectESaIS6_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS6_S8_EERKS6_': > > /usr/src/redhat/BUILD/glibmm-2.6.1/glib/glibmm/wrap.cc: undefined > reference to `_imp___ZN4Glib6quark_E' > .libs/wrap.o(.text+0xa4):/usr/src/redhat/BUILD/glibmm-2.6.1/glib/glibmm/wrap.cc: > undefined reference to `_imp___ZN4Glib26quark_cpp_wrapper_deleted_E' > .libs/wrap.o(.text+0xc4):/usr/src/redhat/BUILD/glibmm-2.6.1/glib/glibmm/wrap.cc: > undefined reference to `_imp___ZN4Glib6quark_E' > .libs/wrap.o(.text+0x1e7): In function `ZN4Glib18wrap_register_initEv': > /usr/src/redhat/BUILD/glibmm-2.6.1/glib/glibmm/wrap.cc:88: undefined > reference to `_imp___ZN4Glib6quark_E' > .libs/wrap.o(.text+0x2d3):/usr/src/redhat/BUILD/glibmm-2.6.1/glib/glibmm/wrap.cc:90: > undefined reference to `_imp___ZN4Glib6quark_E' > .libs/wrap.o(.text+0x2e7):/usr/src/redhat/BUILD/glibmm-2.6.1/glib/glibmm/wrap.cc:91: > undefined reference to `_imp___ZN4Glib26quark_cpp_wrapper_deleted_E' > .libs/wrap.o(.text+0x31f): In function > `ZN4Glib13wrap_registerEmPFPNS_10ObjectBaseEP8_GObjectE': > /usr/src/redhat/BUILD/glibmm-2.6.1/glib/glibmm/wrap.cc:120: undefined > reference to `_imp___ZN4Glib6quark_E' > .libs/wrap.o(.text+0x34e):/usr/src/redhat/BUILD/glibmm-2.6.1/glib/glibmm/wrap.cc:120: > undefined reference to `_imp___ZN4Glib6quark_E' > make[5]: *** [libglibmm-2.4.la] Error 1 > > At which point I think all I can do is to cry for help... > > - Toralf > > _______________________________________________ > gtkmm-list mailing list > [email protected] > http://mail.gnome.org/mailman/listinfo/gtkmm-list > _______________________________________________ gtkmm-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtkmm-list
