worrath
worrath

Reputation: 55

Golang syscall.NewLazyDLL in Linux

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?

Upvotes: 0

Views: 1895

Answers (1)

little ghost
little ghost

Reputation: 21

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.

Upvotes: 1

Related Questions