(Sorry if this is a dupe, but Google Groups seems to have eaten my previous post):
When I try to build pure-gtk's examples/hello.pure as a standalone executable, compilation fails with:
$ pure -v64 -o hello -c hello.pure
glib.pure, line 4574: symbol 'glib::linux' is already defined as a constant
glib.pure, line 4575: symbol 'glib::unix' is already defined as a constant
opt -f -std-compile-opts hello.bc | llc -o hello.s
gcc -c hello.s -o hello.o
g++ -o hello /usr/lib/pure/pure_main.o hello.o -Wl,--no-as-needed /usr/lib/pure/ffi.so /usr/lib/pure/gtk.so /usr/lib/pure/glib.so -L/usr/lib -lpure
/usr/bin/ld: hello.o: undefined reference to symbol 'gtk_window_set_default_size'
/usr/bin/ld: note: 'gtk_window_set_default_size' is defined in DSO /usr/lib/libgtk-x11-2.0.so.0 so try adding it to the linker command line
/usr/lib/libgtk-x11-2.0.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
Shouldn't Pure use the output of `pkg-config --libs gtk+-2.0` in the link command? When I do the individual build steps while substituting this, linking works:
$ pure -o hello.s -c hello.pure
$ gcc -c hello.s -o hello.o
$ g++ -o hello /usr/lib/pure/pure_main.o hello.o -Wl,--no-as-needed /usr/lib/pure/ffi.so /usr/lib/pure/gtk.so /usr/lib/pure/glib.so $(pkg-config --libs gtk+-2.0) -L/usr/lib -lpure
and the 'hello' executable runs without problems.
Should we perhaps store the output of 'pkg-config --libs glib+-2.0' inside glib.so, so Pure can use it when linking executables against pure-gtk's glib.so?