Compiling Giraffe library Hello World on Ubuntu

36 Views Asked by At

I am trying to compile the GTK 3 Hello World Example from the Giraffe Library website.

I installed Poly/ML 5.9.1 from sources, set PATH for the poly executable and LD_LIBRARY_PATH for the libraries. Also, PKG_CONFIG_PATH so that the Makefile would find polyml.pc.

Now I get

$ make polyml
LD_LIBRARY_PATH=/home/gergely/giraffe/lib/polyml:/usr/lib:/home/gergely/local/lib:/usr/lib/x86_64-linux-gnu: \
 GIRAFFE_SML_LIB=/home/gergely/giraffe/lib/sml \
 GIRAFFE_DEBUG=1 \
 /usr/bin/poly --use make-polyml-libs.sml -q
echo "PolyML.export (\"example-1-polyml.o\", main);" > polyml-export.sml
LD_LIBRARY_PATH=/home/gergely/giraffe/lib/polyml:/usr/lib:/home/gergely/local/lib:/usr/lib/x86_64-linux-gnu: \
 GIRAFFE_SML_LIB=/home/gergely/giraffe/lib/sml \
 GIRAFFE_DEBUG=1 \
 /usr/bin/poly --use make-polyml-app.sml -q
cc \
 -g \
 -rdynamic \
 -Wl,--no-copy-dt-needed-entries \
 -Wl,-rpath,/usr/lib \
 -Wl,-rpath,/home/gergely/giraffe/lib/polyml \
 -o example-1-polyml \
 example-1-polyml.o \
 -L/home/gergely/giraffe/lib/polyml -lgiraffe-gobject-2.0 -lgiraffe-gio-2.0 -lgiraffe-gtk-3.0 \
    `PKG_CONFIG_PATH=/usr/lib/pkgconfig:/home/gergely/local/lib/pkgconfig:/usr/lib/x86_64-linux-gnu pkg-config --libs polyml gobject-2.0 gio-2.0 gio-unix-2.0 gtk+-3.0`
    /usr/bin/ld: example-1-polyml.o: warning: relocation in read-only section `.text'
    /usr/bin/ld: example-1-polyml.o:(.data+0x50): undefined reference to `PolyFFIGeneral'
    /usr/bin/ld: example-1-polyml.o:(.data+0x230): undefined reference to `PolyTimingGeneral'
    /usr/bin/ld: example-1-polyml.o:(.data+0x410): undefined reference to `PolyFFIGeneral'
    /usr/bin/ld: warning: creating DT_TEXTREL in a PIE
    collect2: error: ld returned 1 exit status
    make: *** [Makefile:210: example-1-polyml] Error 1

How could I compile this program on my Ubuntu 22.04?

1

There are 1 best solutions below

2
Gergely On

Beforehand on another machine I was able to compile this.

I checked and there I used Poly/ML 5.9 from sources.

Here I installed Poly/ML 5.9 from sources and then recompiled Giraffe Library and then I could compile the Hello World example.