go get github.com/go-vgo/robotgo

然后,我运行此代码,但它无法编译并返回以下错误

package main

import (
    "fmt"

    "github.com/go-vgo/robotgo"
)

func main() {
    x, y := robotgo.GetMousePos()
    fmt.Println("pos: ", x, y)
}

错误:

# command-line-arguments
C:\Go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `default_logger':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../hook/windows/../logger_c.h:39: undefined reference to `__getreent'
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../hook/windows/../logger_c.h:32: undefined reference to `__getreent'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `loggerProc':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/pub.h:97: undefined reference to `__getreent'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `eb_port_retain':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:426: undefined reference to `__assert_func'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `eb_port_wait':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:453: undefined reference to `__assert_func'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `port_list_signal_first':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:648: undefined reference to `__assert_func'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `cleanup_ops':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:857: undefined reference to `__assert_func'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `eb_chan_retain':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:777: undefined reference to `__assert_func'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `eb_assert_print':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:146: undefined reference to `__getreent'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `eb_port_create':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:390: undefined reference to `sched_yield'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `eb_port_free':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:358: undefined reference to `sched_yield'
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:349: undefined reference to `sched_yield'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `eb_port_release':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:432: undefined reference to `__assert_func'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `eb_port_signal':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:439: undefined reference to `__assert_func'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `cleanup_ops':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:866: undefined reference to `sched_yield'
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:866: undefined reference to `sched_yield'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `port_list_signal_first':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:651: undefined reference to `sched_yield'
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:651: undefined reference to `sched_yield'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `recv_unbuf':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:1210: undefined reference to `sched_yield'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o:C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:1180: more undefined references to `sched_yield' follow
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `try_op':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:1249: undefined reference to `__assert_func'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `eb_chan_release':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:783: undefined reference to `__assert_func'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `eb_chan_close':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:796: undefined reference to `sched_yield'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `port_list_signal_first':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:651: undefined reference to `sched_yield'
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:651: undefined reference to `sched_yield'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `eb_chan_close':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:791: undefined reference to `__assert_func'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `eb_chan_buf_cap':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:830: undefined reference to `__assert_func'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `eb_chan_buf_len':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:843: undefined reference to `sched_yield'
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:835: undefined reference to `__assert_func'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `cleanup_ops':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:866: undefined reference to `sched_yield'
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:866: undefined reference to `sched_yield'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `recv_unbuf':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:1210: undefined reference to `sched_yield'
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:1180: undefined reference to `sched_yield'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `port_list_signal_first':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:651: undefined reference to `sched_yield'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o:C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:620: more undefined references to `sched_yield' follow
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `try_op':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:1249: undefined reference to `__assert_func'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `port_list_add':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:597: undefined reference to `sched_yield'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `port_list_signal_first':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:651: undefined reference to `sched_yield'
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:651: undefined reference to `sched_yield'
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:651: undefined reference to `sched_yield'
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:651: undefined reference to `sched_yield'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `port_list_add':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:592: undefined reference to `__assert_func'
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:591: undefined reference to `__assert_func'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `port_list_signal_first':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:648: undefined reference to `__assert_func'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `eb_chan_select_list':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:1299: undefined reference to `__assert_func'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `port_list_rm':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:617: undefined reference to `__assert_func'
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o:C:\Users\sieea\go\src\github.com\robotn\gohook/event/../chan/eb_chan.h:616: more undefined references to `__assert_func' follow
C:\Users\sieea\AppData\Local\Temp\go-link-143133203\000004.o: In function `dispatch_proc':
C:\Users\sieea\go\src\github.com\robotn\gohook/event/dispatch_proc.h:66: undefined reference to `__getreent'
collect2.exe: error: ld returned 1 exit status

我的系统路径中有MinGW-W64,这些代码和库可以在我的台式pc上运行,但我不明白为什么它不能在我的笔记本电脑上运行。我多次重装了MinGW、Go和Goland,试图让它正常工作,但我不知道问题出在哪里。

任何帮助我们都将不胜感激