douju1968 2018-08-21 18:34
浏览 1345

如何使用VSCode在GOARCH = 386中的64位GO项目上使用32位DLL

I have installed VSCode and GO extension with defaults packages. My project need to load a 32-bit DLL. When I launch project with <kbd>F5</kbd>, I get error 193 on syscall.LoadLibrary().

I found on internet that error usually occurs when someone try to load a 32-bit DLL on a 64-bit arch.

I think if I debug with GOARCH=386 I would be able to load the DLL. But every time that I try to execute with GOARCH=386 I get error on VSCode saying that this architecture is unsupported.

Need help.

  • 写回答

2条回答 默认 最新

  • duanbei7005 2018-08-21 18:52
    关注

    The issue is because you are trying to load 32bit dll on 64bit architecture. Use 64 bit dll file. Along with that Install using 64bit dll for golang.

    Just if you try to install delve from 32bit dll on 64 bit OS. This is also mentioned in the issues on github:

    https://github.com/derekparker/delve/issues/20

    VS Code complains if you want to run 32bit dll on 64 bit OS. If you have 32bit dll for golang Uninstall that and install from 64bit dll again.

    评论

报告相同问题?