2019-06-22 06:59

如何在运行时使用.lib和.dll文件调用预构建的API? [关闭]


I have a PCI-E capture card, and I have to use APIs for it supplied by the manufacturer. They provide prebuilt .lib and .dll file. How can I use it in Golang? Or is it possible to get the output of capture card by using GOCV?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • doucigua0278 doucigua0278 2年前

    There three ways:

    1. You can load and call the dll from Go. This is documented in https://github.com/golang/go/wiki/WindowsDLLs.
    2. You can load and call your dll or link the lib using cgo and call this from your Go code. This is more complicated and requires more brain power.
    3. You can use syscall.NewProc.

    I would use the first. They are all documented in https://github.com/golang/go/wiki/WindowsDLLs with examples.

    You can also look on Github for examples by searching for syscall.syscall9.

    If your machine has the drivers and it’s openCV compatible you could use GOCV to capture data.

    点赞 评论 复制链接分享