gtkd-developers/GtkD

Undefined reference to _D3std6string9toStringzFNaNbNeMNkAyaZPya with ldc2

Closed this issue · 11 comments

gtk-d:gtkd 3.9.0: target for configuration "library" is up to date.
gtk-d:gstreamer 3.9.0: target for configuration "library" is up to date.
gtk-d:peas 3.9.0: target for configuration "library" is up to date.
gtk-d:sv 3.9.0: target for configuration "library" is up to date.
gtk-d:vte 3.9.0: target for configuration "library" is up to date.
sampleproj ~main: building configuration "application"...
Linking...
Loader.d:433 : erreur : référence à « _D3std6string9toStringzFNaNbNeMNkAyaZPya » non définie
Loader.d:419 : erreur : référence à « _D3std6string9toStringzFNaNbNeMNkAyaZPya » non définie
collect2: erreur: ld a retourné le statut de sortie 1
Error: /usr/bin/cc failed with status: 1
/usr/bin/ldc failed with exit code 1.

translation: Undefined reference to= référence...non définie

If you updated the compiler recently you may need to force dub to rebuild GtkD, this look like an error that heapons when updating the compiler. An undefined reference to a symbol in Phobos.

Also getPreferredWidth seems to have problems when overriden. It asks both two use (int* minimum, int* natural) and (out int, out int)

And I cleaned. But it could be a compiler issue since gdc and dmd works well.

I can't reproduce the getPreferredWidth issue locally with GtkD master and ldc2 1.25.1.

Can you give me your code snipet (I am not sure if I'm doing that correctly)

Can you give me a snipet that doesn't work, that is a lot easier troubleshooting.

class TextEditorMargin: Box {
	import gobject.c.functions : g_object_newv;
	import gtk.c.types;
	import gtkd.Implement;

	mixin ImplementClass!GtkBox;

	this() {
		super(Orientation.VERTICAL, 0);
		addOnDraw(&onDraw);
	}

	public override void getPreferredWidth(out int minimumWidth, out int naturalWidth) {
		int minimumWidthSuper, naturalWidthSuper;
		super.getPreferredWidth(minimumWidthSuper, naturalWidthSuper);
		minimumWidth = max(minimumWidthSuper, 12);
		naturalWidth = max(naturalWidthSuper, 12);
	}

	public bool onDraw(Context cr, Widget sender) {
		cr.paint();
		return true;
	}
}

This is a problem with gtkd.Implement, that currently only seems to handle out and ref for gtkD classes.

Can I do anything to fix this ?

Should be fixed now for this case, but not all types are handles properly yet.

Okay, but the function does not seems to be called... but not sure about that; and anyway I think you forgot to remove some debug output