Skip to content

Statically compiling with qt/qml for a truly standalone app #174

Open
@amlwwalker

Description

@amlwwalker

I have made my app and now I want to run it on another device. My development machine is OSX El Capitan and the test machine is OSX Yosemite.

Using otool -L I can see the libraries that it is dynamically linking to:

    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
    /usr/local/opt/qt5/lib/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.5.0, current version 5.5.1)
    /usr/local/opt/qt5/lib/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.5.0, current version 5.5.1)
    /usr/local/opt/qt5/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.5.0, current version 5.5.1)
    /usr/local/opt/qt5/lib/QtQml.framework/Versions/5/QtQml (compatibility version 5.5.0, current version 5.5.1)
    /usr/local/opt/qt5/lib/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.5.0, current version 5.5.1)
    /usr/local/opt/qt5/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.5.0, current version 5.5.1)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1258.1.0)
    /System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 57337.40.85)

When I run: go build --ldflags '-extldflags "-static"'
I get:

/usr/local/go/pkg/tool/darwin_amd64/link: running clang++ failed: exit status 1
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Is there another way i can do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions