dongqingchan2385 2017-03-13 21:05
浏览 57

由于版本差异,OSX Go(lang)QML静态编译失败

I am trying to statically compile a go application using Qt and run it on a computer without Go or Qt installed.

At the top of my main.go I have:

// #cgo LDFLAGS: -static -L/Users/$USER/Qt/5.7.0_static_osx/lib -lgb
//go:generate genqrc ui

I have static compiled my application using:

go generate && go build -a -installsuffix cgo

The go generate compiles the .qml files into the binary while as I understand it go build -a -installsuffix cgo statically compiles all the .go and .a files from Qt.

I am using go version go1.8 darwin/amd64 and I have 5.7.0_static_osx Qt in my /Users/$USER/Qt folder and in the /lib folder I have all the .a files

I am using OSX 10.11.6 (El Capitan)

Now the issue is when I move it to another mac I get the error:

​/Users/$USER/Downloads/PACKAGED.app/Contents/Resources
AppSettings.plist
MainMenu.nib
appIcon.icns
PACKAGEDAPP
script
dyld: Library not loaded: /usr/local/opt/qt5/lib/QtWidgets.framework/Versions/5/QtWidgets
  Referenced from: /Users/$USER/Downloads/PACKAGED.app/Contents/Resources/./encryptoclient
  Reason: Incompatible library version: encryptoclient requires version 5.7.0 or later, but QtWidgets provides version 5.4.0
/Users/$USER/Downloads/PACKAGED.app/Contents/Resources/script: line 5:  9987 Trace/BPT trap: 5       ./encryptoclient

Which makes me think that Qt wasn't statically compiled, is this so? And if so, what do I need to do to compile properly?

P.S (FYI) Its in a .app because I have wrapped it in a Platypus app to make moving and running on other computer an easy 'double-click' off the USB stick

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog