Linux 中的 Golang syscall.NewLazyDLL
有没有办法在Ubuntu中加载syscall.NewLazyDLL?
我尝试过:
GOOS=windows GOARCH=amd64 go build -ldflags "-w -s" -o myFileName *.go
但未找到 syscall.NewLazyDLL。
var (
mod = syscall.NewLazyDLL("user32.dll")
procGetWindowText = mod.NewProc("GetWindowTextW")
)
我的目标是加载“windows”系统调用函数,但是从我的主 Ubuntu 操作系统, 所以我不需要切换到 Windows 来编码。 Ubuntu 有什么方法可以从 syscall.NewLazyDLL 调用 Windows 函数吗?还是我必须在 Windows 中为此编写代码?
Is there any way to load the syscall.NewLazyDLL in Ubuntu?
I tried:
GOOS=windows GOARCH=amd64 go build -ldflags "-w -s" -o myFileName *.go
but the syscall.NewLazyDLL is not found.
var (
mod = syscall.NewLazyDLL("user32.dll")
procGetWindowText = mod.NewProc("GetWindowTextW")
)
My goal is to load the "windows" syscall functions, but from my main Ubuntu OS,
so I dont need to switch to Windows to code. Is there any way Ubuntu can call the Windows functions from syscall.NewLazyDLL or do I have to write code in Windows for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然,您必须在 Windows 上,您希望使用 syscall.NewLazyDLL("user32.dll") 为 Windows 而不是 Linux 进行开发。
安装虚拟机。
Of course you have to be on Windows, you are wanting to develop for Windows and not Linux using syscall.NewLazyDLL("user32.dll").
Install a virtual machine.