Re: MinGW build of 2.6.5: Still having auto-import problems ;-(




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)" [ ... ]
#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.

That's actually not quite true, I think. "dllimport" is required in some cases *even when --export-all-symbols is being used* - as far as I can tell from the tests I've done, and also the comments from others in the above mentioned bug report (I think this is essentially what it is all about.) Maybe there aren't any such cases in glibmm, but there certainly are in gtkmm (this is also what the bug report is all about...)

Also, I'm a bit confused about the meaning of the macros here. I thought GLIBMM_DLL meant just "a dll is being built" or "a dll exists" (for the glibmm library), in which case it ought to be defined regardless of whether you want special __declspec directives or not (there should be additional tests deciding if that's necessary.) I may well be wrong, though, or perhaps I wasn't even trying to build a dll (can't check on the machine I'm on now.)

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.
Hmmm. I *think* I passed the correct host settings, but you never know... Again, I'm not able to test right now. Also, I don't necessarily want to change the glibmm setup anyway - maybe it's a gtkmm patch I need. It's a bit surprising that this would be necessary, though, based on the fact that bug 309030 is marked as resolved, but I suppose that also goes for a change to the glibmm setup. Maybe a different glibmm version was used by others who tested this?

- Toralf




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