#1

cgo error on go run main.go - ../../../gopkg.in/qml.v0/bridge.go:16:2: C source files not allowed when not using cgo or SWIG

Openghostopened 11y ago

Hey,

i wanted to try this out on a mac. I understand this was written for ubuntu.

I am playing around also with GXUI, but QML looks like another option. So could you help me with this please..

gedw99-MacBook-Pro:teg-workshop apple$ go run main.go ../../../gopkg.in/qml.v0/bridge.go:16:2: C source files not allowed when not using cgo or SWIG

Context:

gedw99-MacBook-Pro:teg-workshop apple$ go version go version go1.5beta2 darwin/amd64

Activity

7
xlab11y ago

Hello, qml.v0 is quite outdated to be used nowadays, I just updated all the references to qml.v1 and it seems to be working as intended on my mac. Let me know if you get any problems with qml.v1. Use F1 to get help about shortcuts (this is a shortcut-based tool).

I understand this was written for ubuntu.

Nope, I wrote this entirely on my mac, but it works on Ubuntu too.

go version go1.5beta2 darwin/amd64

Uh-oh, qml has some caveats for 1.5, I won't advice using it but should work fine anyways. I used 1.4.2 to test my latest changes. Could be the problem why qml.v0 was refusing to compile. Keep in mind there's a lot of hax going around the Go's runtime.

I am playing around also with GXUI, but QML looks like another option.

That's a great option, works pretty stable, but if you care about windows you should check if QML works there, because it refused to work back in 2014.

ghost11y ago

Thank.

I will install the go version 1.4.

In sublime with the go plugin, when I tried to change the import, it deleted it.

ghost11y ago

Also why is it a PKG ? Something special about pkg

xlab11y ago

In sublime with the go plugin, when I tried to change the import, it deleted it.

Well you should follow the installation procedure from here: https://github.com/go-qml/qml#requirements-on-mac-os-x

One of those steps is to go get gopkg.in/qml.v1. Then do go get gopkg.in/clipboard.v2. But anyways, you shouldn't just change the import, pull the latest commit from this repo, I've added support for qml.v1 — there's a bit more than just replacing the import path.

xlab11y ago

Also why is it a PKG ?

pkg-config uses its env vars to locate Qt sources. Note that your Go distribution should support CGO.

xlab11y ago

I have these lines in my ~/.bash_profile for the homebrew distro of Qt:

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/Cellar/qt5/5.4.2/lib/pkgconfig
export PATH=$PATH:/usr/local/Cellar/qt5/5.4.2/bin
ghost11y ago

much thanks. this is enough info for me to get cracking. really appreciated