go-qml / qml

QML support for the Go language
Other
1.96k stars 189 forks source link

Can't build with go 1.5 #157

Open mpiannucci opened 8 years ago

mpiannucci commented 8 years ago

I am rebuilding with Go 1.5 on OS X and I receiving the following error:

go get -v gopkg.in/qml.v1 
------------------------------------------------------------------
gopkg.in/qml.v1
# gopkg.in/qml.v1
clang: error: unknown argument: '-framework\'
clang: error: unknown argument: '-framework\'
clang: error: unknown argument: '-framework\'
clang: error: unknown argument: '-framework\'
clang: error: unknown argument: '-framework\'
clang: error: unknown argument: '-framework\'
clang: error: no such file or directory: 'QtWidgets'
clang: error: no such file or directory: 'QtQuick'
clang: error: no such file or directory: 'QtGui'
clang: error: no such file or directory: 'QtQml'
clang: error: no such file or directory: 'QtNetwork'
clang: error: no such file or directory: 'QtCore'

All of my other Qt apps compile fine. I am using Qt 5.5.

ntcong commented 8 years ago

what version of Xcode are you using? OSX version?

I switched to go 1.4.2 and the problem is still there, so I don't think the problem is in go 1.5

ntcong commented 8 years ago

Okay, so the problem is the pkg-config generated

$ pkg-config --libs Qt5Core
-F/usr/local/Cellar/qt5/HEAD/lib -framework\ QtCore

while it should be -framework QtCore. It can be fixed by go to /usr/local/lib/pkgconfig, edit QtCore.pc, remove the quote around '-framework QtCore ' so it would be -framework QtCore.

And do the same for all 6 files clang complains above. It'll compile

dtoebe commented 8 years ago

I'm used to Linux, on a Mac how do I get rights to edit them? I have tried sudo, creating root user, and adding my user to admin group. and no matter what when I vi into the file it is RO

mpiannucci commented 8 years ago

This looks like it should fix it.. Its a little confusing what caused this because I had previously installed everything successfully with homebrew. It seems like the Qt 5.5 homebrew may be breaking the package config.

ntcong commented 8 years ago

@dtoebe trying using any other editor, I also can't edit with vim, but using neovim or emacs with sudo work.

dtoebe commented 8 years ago

@ntcong , ha ha... So simple... Thanks that worked

dashed commented 8 years ago

Can confirm https://github.com/go-qml/qml/issues/157#issuecomment-133347954 fixes it.

kellydunn commented 8 years ago

Also confirming @ntcong 's comment worked for me :). Thanks!