Tuesday, April 22, 2025
HomeGolangErrors utilizing robotgo on FreeBSD - Getting Assist

Errors utilizing robotgo on FreeBSD – Getting Assist


I perceive robotgo is constructed for Linux and Mac OS, however I assume FreeBSD needs to be pretty related.

I consider have all the required libraries, however they’re situated at /usr/native/embody as a substitute of /usr/embody. By that, I imply that I’ve grepped the headers situated in /usr/native/embody for a number of of the symbols the compiler was complaining about and located them there.

When making an attempt to construct the easy mouse instance on my system, I find yourself getting unknown symbols akin to:

ld: error: undefined image: XCloseDisplay
>>> referenced by xdisplay_c.h:13 (/dwelling/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 (/dwelling/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 (/dwelling/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 instances

I attempted exporting variables to see if which may assist, however no change:

export CGO_LDFLAGS=-L/usr/native/embody

Any assist can be drastically appreciated.

The error appears to be the loader complaining it couldn’t discover an exterior perform in some object library fairly than the compiler complaining it couldn’t discover an import for that perform in some header file.
Possibly the item recordsdata are underneath /usr/native/lib? So that you’d need CGO_LDFLAGS=-L/usr/native/lib?

Thanks for the reply, I believe that obtained me nearer!

I began with a brand new terminal simply to filter out my env:


export CGO_LDFLAGS=-L/usr/native/lib
construct [mouse] (go) 
Constructing mouse 
# github.com/go-vgo/robotgo
error: unable to rename non permanent '/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 /dwelling/person/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/robotgo.go:48:
In file included from /dwelling/person/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/goWindow.h:12:
/dwelling/person/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]
/dwelling/person/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]
/dwelling/person/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 /dwelling/person/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/robotgo.go:48:
In file included from /dwelling/person/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/goWindow.h:12:
/dwelling/person/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]
/dwelling/person/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]
/dwelling/person/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: working 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 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 instances

ld: error: undefined image: XOpenDisplay
>>> referenced by xdisplay_c.h:27 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 instances

ld: error: undefined image: XResourceManagerString
>>> referenced by screen_c.h:32 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 instances

ld: error: undefined image: XGetImage
>>> referenced by screengrab_c.h:114 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 instances

ld: error: undefined image: XSync
>>> referenced by mouse_c.h:97 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 instances

ld: error: undefined image: XQueryPointer
>>> referenced by mouse_c.h:132 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 instances

ld: error: undefined image: ground
>>> referenced by mouse_c.h:296 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 instances

ld: error: undefined image: XInternAtom
>>> referenced by pub.h:156 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 instances

ld: error: undefined image: XFree
>>> referenced by window.h:113 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 instances

ld: error: undefined image: XGetInputFocus
>>> referenced by window.h:422 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 (/dwelling/person/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 instances

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 /dwelling/person/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/robotgo.go:48:
In file included from /dwelling/person/go/pkg/mod/github.com/go-vgo/robotgo@v0.110.6/window/goWindow.h:12:
/dwelling/person/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]
/dwelling/person/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]
/dwelling/person/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 robotically 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 forth.).

EDIT:
The primary half seems prefer it was both a permission error, or my construct script cleansing up a bit too early (extra seemingly). The construct script has callbacks that run on the finish to take away non permanent 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.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments