gotk3: [BUG] could not determine kind of name for C.pango_attr_insert_hyphens_new

Describe the bug Can’t build this lib

To Reproduce Steps to reproduce the behavior:

Let ContainerFile.simple to be as follows

FROM centos

ENV GOPATH=/go
ENV GOBIN=${GOPATH}/bin

RUN yum install -y golang.x86_64 glib2-devel.x86_64 cairo-gobject-devel.x86_64 pango-devel.x86_64 gtk3-devel.x86_64 git.x86_64 unzip.x86_64 mesa-libGL.x86_64 mesa-dri-drivers.x86_64 libXrender.x86_64 libXtst.x86_64 xorg-x11-fonts-100dpi.noarch xorg-x11-fonts-75dpi.noarch xorg-x11-fonts-ISO8859-1-100dpi.noarch xorg-x11-fonts-ISO8859-1-75dpi.noarch xorg-x11-fonts-ISO8859-14-100dpi.noarch xorg-x11-fonts-ISO8859-14-75dpi.noarch xorg-x11-fonts-ISO8859-15-100dpi.noarch xorg-x11-fonts-ISO8859-15-75dpi.noarch xorg-x11-fonts-ISO8859-2-100dpi.noarch xorg-x11-fonts-ISO8859-2-75dpi.noarch xorg-x11-fonts-ISO8859-9-100dpi.noarch xorg-x11-fonts-ISO8859-9-75dpi.noarch xorg-x11-fonts-Type1.noarch xorg-x11-fonts-cyrillic.noarch xorg-x11-fonts-ethiopic.noarch xorg-x11-fonts-misc.noarch wget.x86_64

RUN mkdir /go

RUN go get github.com/gotk3/gotk3/gtk

CMD [ "bash" ]

and, let’s use the following Makefile


test:
	podman build -f ContainerFile.simple -t gogtk .
	podman run --rm -it \
		-v /tmp/.X11-unix:/tmp/.X11-unix \
		-v /dev/dri:/dev/dri \
		--security-opt=label=type:container_runtime_t \
		-e DISPLAY \
		gogtk

Run make test

Expected behavior No errors.

Error messages If applicable, add copy the log message to help explain your problem.

...
STEP 6: RUN go get github.com/gotk3/gotk3/gtk
# github.com/gotk3/gotk3/pango
go/src/github.com/gotk3/gotk3/pango/pango-attributes.go:191:7: could not determine kind of name for C.pango_attr_insert_hyphens_new
Error: error building at STEP "RUN go get github.com/gotk3/gotk3/gtk": error while running runtime: exit status 2
make: *** [Makefile:3: test] Error 125

Environment: gtk3 version: ‘3.22.30’ go version: ‘1.14.7’ os: ‘CentOS Linux release 8.3.2011 linux/amd64’ podman: ‘2.2.1’

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 3
  • Comments: 22

Most upvoted comments

I’m on Ubuntu 18.04 LTS. I use this to run with gotk3 :

go run -tags pango_1_42,gtk_3_22 .

The initial run took some time for all the compilation, but afterwards it was quick.

My libgtk version:

$ apt show libgtk-3-0                       
Package: libgtk-3-0
Version: 3.22.30-1ubuntu4
Priority: optional
Section: libs
Source: gtk+3.0
Origin: Ubuntu

I succeeded to use v0.5.2 with Ubuntu-20.04LTS (using WSL2). Thus, this bug is only relevant for Ubuntu-18.04. The trick is probably to get manually the pangolib-dev the most recent for 18.04.

yeah today I got hit this as well while building my app on RHEL8 clone - built fine on Ubuntu 20, 22, MacOS etc…

Looks like it is a problem with old system and we need to pass the explicit go build tag version. `go build --tags “pango_1_42 gtk_3_22”

I do confirm it is working fine for me with v0.5.0 and go 1.14 . Thanks

Got it working on older OS versions

Have same problem using WSL1 Ubuntu 18.04 go1.14.8

Got it working with these steps:

1. cd to a sample folder: gtk-examples/simple  ( https://github.com/gotk3/gotk3-examples )
2. go mod init main
3. go mod tidy
4. edit go.mod version to v0.5.0
That's it, should build ok

go version 1.13 is probably the minimum version to make it work with these specific steps

Was able to get it to work also on Chromebook Crostini Debian 9 (stretch)

As a side note specific to WSL or WSL1, I’m using X Server as https://sourceforge.net/projects/vcxsrv

Here's a cut and paste of my command line from WSL:

john@GUAVA:~/egd/code/go/gotk3-examples/gtk-examples/simple$ go build .
# github.com/gotk3/gotk3/pango
/home/john/go/src/github.com/gotk3/gotk3/pango/pango-attributes.go:191:7: could not determine kind of name for C.pango_attr_insert_hyphens_new


john@GUAVA:~/egd/code/go/gotk3-examples/gtk-examples/simple$ go mod init main
go: creating new go.mod: module main
john@GUAVA:~/egd/code/go/gotk3-examples/gtk-examples/simple$ cat go.mod
module main

go 1.14
john@GUAVA:~/egd/code/go/gotk3-examples/gtk-examples/simple$ go mod tidy
go: finding module for package github.com/gotk3/gotk3/gtk
go: found github.com/gotk3/gotk3/gtk in github.com/gotk3/gotk3 v0.5.2
john@GUAVA:~/egd/code/go/gotk3-examples/gtk-examples/simple$ cat go.mod
module main

go 1.14

require github.com/gotk3/gotk3 v0.5.2
john@GUAVA:~/egd/code/go/gotk3-examples/gtk-examples/simple$ vi go.mod
john@GUAVA:~/egd/code/go/gotk3-examples/gtk-examples/simple$ cat go.mod
module main

go 1.14

require github.com/gotk3/gotk3 v0.5.0
john@GUAVA:~/egd/code/go/gotk3-examples/gtk-examples/simple$ go build -v .
main
john@GUAVA:~/egd/code/go/gotk3-examples/gtk-examples/simple$

Hello all, can someone pls give me the step by step solution for this issue? image I’ve built pangolin lib from src but it didn’t fix the problem. I’m new to GO, so I was going to ask for detailed help, thx.