duandianwen1723 2017-06-10 02:57
浏览 60

从Linux为Windows开发的IDE和工具问题

I am trying to develop a simple windows GUI in go (first attempt).

After considering a few packages to get me started, I landed on this https://github.com/lxn/walk and it seemed ideal. I cross-compiled from my ubuntu laptop and the provided demo worked on all target platforms (win7/8/10)

The problems came when I tried to start developing from my linux laptop - initially in atom, but I've since tried with sublime, emacs and phpstorm and noticed an issue with go get (so I'm guessing it's the underlying go tooling that's failing)

The first error I'm seeing is:

/../github.com/lxn/walk/tooltiperrorpresenter.go:8: undefined: ToolTip

This affects development across all affected IDEs tested:

  • disables autocomplete
  • halts linting
  • cant test
  • gofmt worked in some (perhaps tool ordering) affecting any file referencing this lib.

And this is the first of many errors which seem to be due to the library importing its internal win package which contains files which are marked with the flag:

// +build windows

I cunningly decided to start ripping out these tags from the lib - hoping that would at least allow me to get on with development, but then I started seeing new errors regarding too many arguments being passed to syscalls in the win package - presumably because the different platforms (win/nix) have different numbers of parameters in those syscalls.

I then tried marking everything with the //+build windows flag, but the parade of errors remained unchanged.

I found some issues on the project github which are related: https://github.com/lxn/win/issues/26 : no buildable Go source files and there are solutions for "go getting" the files but none so far for my IDE woes.

I've also seen this type of issue in some other windows specific go libraries so I don't think it's an issue for the package author. But I would be interested to hear any solutions from a code architecture perspective if they exist

I haven't actually tried doing this from a windows VM yet (I presume that would solve the issue from my end) - but its a bit of a jarring solution as I'm already juggling vms to test the app so I'm keen to find another way.

TLDR:

Do I have to work from Windows machine / vm in order to have a fully functional IDE when developing for windows from linux or is there a way to satisfy the go tooling

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号
    • ¥15 基于单片机的靶位控制系统
    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度