I perceive robotgo is constructed for Linux and Mac OS, however I suppose FreeBSD must be pretty related.
I consider have all the mandatory libraries, however they’re situated at /usr/native/embrace as a substitute of /usr/embrace. By that, I imply that I’ve grepped the headers situated in /usr/native/embrace for just a few of the symbols the compiler was complaining about and located them there.
When trying to construct the easy mouse instance on my system, I find yourself getting unknown symbols resembling:
ld: error: undefined image: XCloseDisplay
>>> referenced by xdisplay_c.h:13 (/house/w/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/display/../base/xdisplay_c.h:13)
>>> /tmp/go-link-2600121927/000002.o:(XCloseMainDisplay)
>>> referenced by xdisplay_c.h:13 (/house/w/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/display/../base/xdisplay_c.h:13)
>>> /tmp/go-link-2600121927/000002.o:(XGetMainDisplay)
>>> referenced by screen_c.h:48 (/house/w/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/display/screen_c.h:48)
>>> /tmp/go-link-2600121927/000002.o:(sys_scale)
>>> referenced 28 extra occasions
I attempted exporting variables to see if that may assist, however no change:
export CGO_LDFLAGS=-L/usr/native/embrace
Any assist could be tremendously appreciated.
The error appears to be the loader complaining it couldn’t discover an exterior perform in some object library somewhat than the compiler complaining it couldn’t discover an import for that perform in some header file.
Perhaps the thing recordsdata are below /usr/native/lib
? So that you’d need CGO_LDFLAGS=-L/usr/native/lib
?
Thanks for the reply, I feel that received me nearer!
I began with a brand new terminal simply to filter my env:
export CGO_LDFLAGS=-L/usr/native/lib
construct [mouse] (go)
Constructing mouse
# github.com/go-vgo/robotgo
error: unable to rename momentary '/tmp/go-build4173788811/b002//_cgo_-5eddc94d.o.tmp' to output file '/tmp/go-build4173788811/b002//_cgo_.o': 'No such file or listing'
1 error generated.
# github.com/go-vgo/robotgo
In file included from /house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/robotgo.go:48:
In file included from /house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/goWindow.h:12:
/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/window.h:242:1: warning: non-void perform doesn't return a price in all management paths [-Wreturn-type]
/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/window.h:266:1: warning: non-void perform doesn't return a price in all management paths [-Wreturn-type]
/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/window.h:281:1: warning: non-void perform doesn't return a price in all management paths [-Wreturn-type]
Unusual, I reran the command once more and ended up again the place I used to be. I checked the env and the variable was nonetheless there.
EDIT: right here is the 2nd run:
construct [mouse] (go)
Constructing mouse
# github.com/go-vgo/robotgo
In file included from /house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/robotgo.go:48:
In file included from /house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/goWindow.h:12:
/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/window.h:242:1: warning: non-void perform doesn't return a price in all management paths [-Wreturn-type]
/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/window.h:266:1: warning: non-void perform doesn't return a price in all management paths [-Wreturn-type]
/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/window.h:281:1: warning: non-void perform doesn't return a price in all management paths [-Wreturn-type]
# robotgo/mouse
/usr/native/go123/pkg/device/freebsd_amd64/hyperlink: operating cc failed: exit standing 1
/usr/bin/cc -m64 -o $WORK/b001/exe/a.out -Wl,--export-dynamic-symbol=__progname -Wl,--export-dynamic-symbol=_cgo_panic -Wl,--export-dynamic-symbol=_cgo_topofstack -Wl,--export-dynamic-symbol=crosscall2 -Wl,--export-dynamic-symbol=environ -Qunused-arguments -Wl,--compress-debug-sections=zlib /tmp/go-link-3870144045/go.o /tmp/go-link-3870144045/000000.o /tmp/go-link-3870144045/000001.o /tmp/go-link-3870144045/000002.o /tmp/go-link-3870144045/000003.o /tmp/go-link-3870144045/000004.o /tmp/go-link-3870144045/000005.o /tmp/go-link-3870144045/000006.o /tmp/go-link-3870144045/000007.o /tmp/go-link-3870144045/000008.o /tmp/go-link-3870144045/000009.o /tmp/go-link-3870144045/000010.o /tmp/go-link-3870144045/000011.o /tmp/go-link-3870144045/000012.o /tmp/go-link-3870144045/000013.o /tmp/go-link-3870144045/000014.o /tmp/go-link-3870144045/000015.o /tmp/go-link-3870144045/000016.o /tmp/go-link-3870144045/000017.o /tmp/go-link-3870144045/000018.o /tmp/go-link-3870144045/000019.o /tmp/go-link-3870144045/000020.o /tmp/go-link-3870144045/000021.o /tmp/go-link-3870144045/000022.o /tmp/go-link-3870144045/000023.o /tmp/go-link-3870144045/000024.o /tmp/go-link-3870144045/000025.o /tmp/go-link-3870144045/000026.o -L/usr/native/lib -L/usr/native/lib -lpthread -L/usr/native/lib -L/usr/native/lib -L/usr/native/lib -no-pie
ld: error: undefined image: XCloseDisplay
>>> referenced by xdisplay_c.h:13 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/display/../base/xdisplay_c.h:13)
>>> /tmp/go-link-3870144045/000002.o:(XCloseMainDisplay)
>>> referenced by xdisplay_c.h:13 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/display/../base/xdisplay_c.h:13)
>>> /tmp/go-link-3870144045/000002.o:(XGetMainDisplay)
>>> referenced by screen_c.h:48 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/display/screen_c.h:48)
>>> /tmp/go-link-3870144045/000002.o:(sys_scale)
>>> referenced 28 extra occasions
ld: error: undefined image: XOpenDisplay
>>> referenced by xdisplay_c.h:27 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/display/../base/xdisplay_c.h:27)
>>> /tmp/go-link-3870144045/000002.o:(XGetMainDisplay)
>>> referenced by xdisplay_c.h:31 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/display/../base/xdisplay_c.h:31)
>>> /tmp/go-link-3870144045/000002.o:(XGetMainDisplay)
>>> referenced by xdisplay_c.h:36 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/display/../base/xdisplay_c.h:36)
>>> /tmp/go-link-3870144045/000002.o:(XGetMainDisplay)
>>> referenced 25 extra occasions
ld: error: undefined image: XResourceManagerString
>>> referenced by screen_c.h:32 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/display/screen_c.h:32)
>>> /tmp/go-link-3870144045/000002.o:(sys_scale)
ld: error: undefined image: XrmGetStringDatabase
>>> referenced by screen_c.h:34 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/display/screen_c.h:34)
>>> /tmp/go-link-3870144045/000002.o:(sys_scale)
ld: error: undefined image: XrmGetResource
>>> referenced by screen_c.h:39 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/display/screen_c.h:39)
>>> /tmp/go-link-3870144045/000002.o:(sys_scale)
ld: error: undefined image: XrmDestroyDatabase
>>> referenced by screen_c.h:45 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/display/screen_c.h:45)
>>> /tmp/go-link-3870144045/000002.o:(sys_scale)
ld: error: undefined image: XDefaultRootWindow
>>> referenced by screengrab_c.h:114 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/display/screengrab_c.h:114)
>>> /tmp/go-link-3870144045/000002.o:(copyMMBitmapFromDisplayInRect)
>>> referenced by mouse_c.h:132 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/mouse/mouse_c.h:132)
>>> /tmp/go-link-3870144045/000002.o:(location)
>>> referenced by mouse_c.h:132 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/mouse/mouse_c.h:132)
>>> /tmp/go-link-3870144045/000002.o:(smoothlyMoveMouse)
>>> referenced 2 extra occasions
ld: error: undefined image: XGetImage
>>> referenced by screengrab_c.h:114 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/display/screengrab_c.h:114)
>>> /tmp/go-link-3870144045/000002.o:(copyMMBitmapFromDisplayInRect)
ld: error: undefined image: XWarpPointer
>>> referenced by mouse_c.h:95 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/mouse/mouse_c.h:95)
>>> /tmp/go-link-3870144045/000002.o:(moveMouse)
>>> referenced by mouse_c.h:95 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/mouse/mouse_c.h:95)
>>> /tmp/go-link-3870144045/000002.o:(dragMouse)
>>> referenced by mouse_c.h:95 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/mouse/mouse_c.h:95)
>>> /tmp/go-link-3870144045/000002.o:(smoothlyMoveMouse)
>>> referenced 2 extra occasions
ld: error: undefined image: XSync
>>> referenced by mouse_c.h:97 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/mouse/mouse_c.h:97)
>>> /tmp/go-link-3870144045/000002.o:(moveMouse)
>>> referenced by mouse_c.h:97 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/mouse/mouse_c.h:97)
>>> /tmp/go-link-3870144045/000002.o:(dragMouse)
>>> referenced by mouse_c.h:155 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/mouse/mouse_c.h:155)
>>> /tmp/go-link-3870144045/000002.o:(toggleMouse)
>>> referenced 33 extra occasions
ld: error: undefined image: XQueryPointer
>>> referenced by mouse_c.h:132 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/mouse/mouse_c.h:132)
>>> /tmp/go-link-3870144045/000002.o:(location)
>>> referenced by mouse_c.h:132 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/mouse/mouse_c.h:132)
>>> /tmp/go-link-3870144045/000002.o:(smoothlyMoveMouse)
>>> referenced by mouse_c.h:132 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/mouse/mouse_c.h:132)
>>> /tmp/go-link-3870144045/000002.o:(_cgo_dd183ab93a93_Cfunc_location)
ld: error: undefined image: XTestFakeButtonEvent
>>> referenced by mouse_c.h:154 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/mouse/mouse_c.h:154)
>>> /tmp/go-link-3870144045/000002.o:(toggleMouse)
>>> referenced by mouse_c.h:154 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/mouse/mouse_c.h:154)
>>> /tmp/go-link-3870144045/000002.o:(clickMouse)
>>> referenced by mouse_c.h:154 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/mouse/mouse_c.h:154)
>>> /tmp/go-link-3870144045/000002.o:(clickMouse)
>>> referenced 11 extra occasions
ld: error: undefined image: ground
>>> referenced by mouse_c.h:296 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/mouse/mouse_c.h:296)
>>> /tmp/go-link-3870144045/000002.o:(smoothlyMoveMouse)
>>> referenced by mouse_c.h:296 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/mouse/mouse_c.h:296)
>>> /tmp/go-link-3870144045/000002.o:(smoothlyMoveMouse)
ld: error: undefined image: XSetErrorHandler
>>> referenced by pub.h:118 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/pub.h:118)
>>> /tmp/go-link-3870144045/000002.o:(XDismissErrors)
>>> referenced by pub.h:123 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/pub.h:123)
>>> /tmp/go-link-3870144045/000002.o:(XDismissErrors)
>>> referenced by pub.h:118 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/pub.h:118)
>>> /tmp/go-link-3870144045/000002.o:(is_valid)
>>> referenced 23 extra occasions
ld: error: undefined image: XInternAtom
>>> referenced by pub.h:156 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/pub.h:156)
>>> /tmp/go-link-3870144045/000002.o:(initWindow)
>>> referenced by pub.h:157 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/pub.h:157)
>>> /tmp/go-link-3870144045/000002.o:(initWindow)
>>> referenced by pub.h:158 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/pub.h:158)
>>> /tmp/go-link-3870144045/000002.o:(initWindow)
>>> referenced 10 extra occasions
ld: error: undefined image: XFree
>>> referenced by window.h:113 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/window.h:113)
>>> /tmp/go-link-3870144045/000002.o:(is_valid)
>>> referenced by window.h:409 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/window.h:409)
>>> /tmp/go-link-3870144045/000002.o:(get_active)
>>> referenced by pub.h:202 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/pub.h:202)
>>> /tmp/go-link-3870144045/000002.o:(GetWindowProperty)
>>> referenced 7 extra occasions
ld: error: undefined image: XGetInputFocus
>>> referenced by window.h:422 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/window.h:422)
>>> /tmp/go-link-3870144045/000002.o:(get_active)
ld: error: undefined image: XGetWindowProperty
>>> referenced by pub.h:186 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/pub.h:186)
>>> /tmp/go-link-3870144045/000002.o:(GetWindowProperty)
ld: error: undefined image: XGetWindowAttributes
>>> referenced by pub.h:225 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/pub.h:225)
>>> /tmp/go-link-3870144045/000002.o:(set_active)
>>> referenced by window.h:317 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/window.h:317)
>>> /tmp/go-link-3870144045/000002.o:(set_active)
>>> referenced by win_sys.h:113 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/win_sys.h:113)
>>> /tmp/go-link-3870144045/000002.o:(get_client)
ld: error: undefined image: XStringToKeysym
>>> referenced by keycode_c.h:65 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/key/keycode_c.h:65)
>>> /tmp/go-link-3870144045/000001.o:(keyCodeForChar)
>>> referenced by keycode_c.h:65 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/key/keycode_c.h:65)
>>> /tmp/go-link-3870144045/000001.o:(toggleKey)
>>> referenced by keypress_c.h:331 (/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/key/keypress_c.h:331)
>>> /tmp/go-link-3870144045/000001.o:(input_utf)
>>> referenced 1 extra occasions
ld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
# github.com/go-vgo/robotgo
In file included from /house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/robotgo.go:48:
In file included from /house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/goWindow.h:12:
/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/window.h:242:1: warning: non-void perform doesn't return a price in all management paths [-Wreturn-type]
/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/window.h:266:1: warning: non-void perform doesn't return a price in all management paths [-Wreturn-type]
/house/consumer/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/window.h:281:1: warning: non-void perform doesn't return a price in all management paths [-Wreturn-type]
I’ve my very own wrapper utility (construct) which routinely runs the suitable go cmds, on this case, go set up -a -race -ldflags (after which passes a bunch that the utility determines from the repository, present dir, and so on.).
EDIT:
The primary half seems to be prefer it was both a permission error, or my construct script cleansing up a bit too early (extra possible). The construct script has callbacks that run on the finish to take away momentary recordsdata. Why the primary run appeared to work higher and the second not is unusual.
EDIT:
Rerunning in a brand new terminal window with the variable set doesn’t get me again to one of the best output but, so it appears I’m again to sq. 1.
Effectively, the second run does embrace “-L/usr/native/lib” (on the finish of the lengthy /usr/bin/cc
command line) so that you succeeded in altering the place it’s trying. However it’s nonetheless not discovering!
I took a take a look at the robotgo mission and it appears others even have construct issues; they appear to be utilizing the mission proprietor’s process involving go construct
(with numerous tweaks to atmosphere and command line flags). Does your construct device boil all the way down to that?
I don’t know sufficient in regards to the deets of this mission to be of additional assist. I see you’ve raised a difficulty on github, that ought to work. You may attempt including a log with the complete command strains that your construct device is producing, and a sign of the place you discovered the precise X11 object recordsdata.