I'm trying to build the gtkmm library using MSVC. One of its source files declares a struct called BuiltinStockID together with some objects of that type - e.g.

Code:
// In the header file:-
namespace Gtk
{
	struct BuiltinStockID
	{
		const char* id;
	};

	namespace Stock
	{
		extern GTKMM_API const Gtk::BuiltinStockID APPLY;  /* @image gtk-apply.png  */
		extern GTKMM_API const Gtk::BuiltinStockID CANCEL; /* @image gtk-cancel.png */
		extern GTKMM_API const Gtk::BuiltinStockID OK;     /* @image gtk-ok.png     */
	}
}
GTKMM_API is obviously _declspec(dllimport) (or export) as appropriate. It seems a bit unusual to use extern in addition GTKMM_API but the code won't compile if I try to exclude it. The actual instantiations are in one of the library's source files- e.g.

Code:
// In a source file
const Gtk::BuiltinStockID APPLY  = { GTK_STOCK_APPLY };
const Gtk::BuiltinStockID CANCEL = { GTK_STOCK_CANCEL };
const Gtk::BuiltinStockID OK     = { GTK_STOCK_OK };
GTK_STOCK_APPLY etc are simple strings such as "gtk-apply". They mostly refer to image files for the library to load (in this case, for dialog button images) although that's probably not relevant to the problem.

If I run dumpbin /EXPORTS on the built DLL it does seem to have some exported symbols with the names Gtk::Stock::APPLY, Gtk::Stock::CANCEL, Gtk::Stock::OK etc. However, if I write this in one of my own source files:-

Code:
Gtk::BuiltinStockID MyStockID;
MyStockID = Gtk::Stock::CANCEL;  //  <--- debugger reports <Bad Ptr>
You can see that the Gtk::Stock::CANCEL object is invalid (my debugger reports it as a bad pointer). Likewise, if I try to pass Gtk::Stock::CANCEL as a parameter to a function. What's going wrong