ui
ui copied to clipboard
How to install on OSX 10.11.4
I just run go get
command, the go compiler said can not find ui.h, then I put the files in libui
to the root of the github.com/andlabs/ui
and redo the go get
the compiler return this
CosPotato-Mac:~ CosPotato$ go get github.com/andlabs/ui
# github.com/andlabs/ui
ld: library not found for -lui
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And my go version and gcc version
CosPotato-Mac:~ CosPotato$ go version
go version go1.6 darwin/amd64
CosPotato-Mac:~ CosPotato$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
CosPotato-Mac:~ CosPotato$
How can i build the enviroment greatly appreciated
You cannot just drop the libui source tree into the ui source tree. You have to build libui, then drop its output dylibs into the ui source tree. The instructions are in ui's README.
I did all the steps in README, make the libui, copy the libui.A.dylib to the root of this repo and symlink it as libui.dylib in the same path. Then go install
worked. But when i run the application, another error show up
CosPotato-Mac:~ CosPotato$ $GOBIN/hello
dyld: Library not loaded: @rpath/libui.A.dylib
Referenced from: /Users/CosPotato/GoProjects/bin/hello
Reason: image not found
Trace/BPT trap: 5
I had the same problem. The solution is simple: the generated file from libui is not libui.A.dylib
but libui.0.dylib
:-) @see https://github.com/andlabs/ui/issues/112 for all my problems.
@sharpner But I found that the file in libui/out
are libui.A.dylib
and maybe a hard link file libui.dylib
.
Now the problem solved by copy the libui.A.dylib
to $GOBIN
,it's work! :)
You can also use a Mac OS X app folder:
ls GoApp.app/Contents/MacOS
goapp libui.A.dylib
and the go binary is compiled with:
tool -L GoApp.app/Contents/MacOS/goapp
GoApp.app/Contents/MacOS/goapp:
@rpath/libui.A.dylib (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1256.14.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
libui.dylib
is a symbolic link, not a hard link.
I can run the example now in terminal or just double click it. But I can not debug in idea with go plugin.Because the plugin does not copy the dylib to the runtime folder. :-) The libui.dylib in libui/out IS a symbolic link, i did not read the information carefully before. I'm so sorry. Greatly Appreciate:)
I wouldn't know how to fix IDEA; sorry. Perhaps there are some IDEA folks who can help, though?... I don't see why it wouldn't be possible; this isn't the only project that relies on a .so in the executable directory (it might be the first in Go though; it might not need to be in the future if distros make libui available in package repositories).
Does it work naturally in IDEA now?
Asking again now that libui is statically linked (and has been for a while): is IDEA fixed?
Friendly poke