Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory allocation failed when compiling with gdc #341

Open
Tooniis opened this issue Jul 2, 2021 · 1 comment
Open

Memory allocation failed when compiling with gdc #341

Tooniis opened this issue Jul 2, 2021 · 1 comment

Comments

@Tooniis
Copy link

Tooniis commented Jul 2, 2021

Testing with this small program:

import gtk.Application;

int main(string[] args) {
	Application app = new Application("org.remote.Remote", GApplicationFlags.FLAGS_NONE);

	return app.run(args);
}

It works when compiled with ldc:

$ ldc -I/usr/include/d/gtkd-3 -L-lgtkd-3 main.d
$ ./main

(main:192195): GLib-GIO-WARNING **: 18:50:42.567: Your application does not implement g_application_activate() and has no handlers connected to the 'activate' signal.  It should do one of these.

But when compiled with gdc, it no longer works:

$ gdc -I/usr/include/d/gtkd-3 -lgtkd-3 main.d
$ ./a.out
core.exception.OutOfMemoryError@/build/gcc/src/gcc/libphobos/libdruntime/core/exception.d(705): Memory allocation failed
----------------

Is it just missing some compiler/linker flags, or is there more to it?

@MikeWey
Copy link
Member

MikeWey commented Jul 2, 2021

You will also need to link with libdl by adding -ldl, but this is also needed for ldc, and i would expect a different error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants