首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >VSCode Linux tasks.json MQL4编译

VSCode Linux tasks.json MQL4编译
EN

Stack Overflow用户
提问于 2020-09-30 12:47:44
回答 1查看 299关注 0票数 0

我将从MetaEditor切换到VSCode来为MetaTrader4进行开发。

我正在通过Wine在Linux中使用MetaTrader4和MetaEditor。( MetaEditor在Wine中运行得相当糟糕)

我想创建一个任务来编译代码,并希望将相同的错误日志返回给VSCode,以便进一步调试代码,就像我使用MetaEditor一样。

我使用这篇文章来弄清楚哪个命令行界面命令是用来编译MQL4的:Compiling MQL4 via command line through wine metaeditor.exe

代码语言:javascript
运行
复制
/usr/bin/wine /path/to/MT4/metaeditor.exe /compile:"Z:\path\to\MT4\MQL4\Experts\Foo\Bar_EA.mq4" /include:"Z:\path\to\MT4\MQL4" /log

我的问题是,我不理解也找不到任何资源来解释tasks.json文件中的“命令”或可用变量列表的作用。如"/include:“或"presentation":,${file}等。

因此,我进行了一些猜测,并将其拼凑成到目前为止的样子:

代码语言:javascript
运行
复制
{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "MQL4 Compile",
            "type": "shell",
            "command": "/usr/bin/wine /.wine/drive_c/Program Files (x86)/FXChoice MetaTrader 4/metaeditor.exe",
            "args": [
                "/compile:${file}"
            ]
        }
    ]
}

这可能不是很正确。感谢你的帮助,谢谢

EN

回答 1

Stack Overflow用户

发布于 2020-11-10 05:39:40

代码语言:javascript
运行
复制
{
  "version": "2.0.0",
  "tasks": 
  [
    {
      "label": "MQL4-Compile",
      "group": 
      {
        "kind"      : "build",
        "isDefault" : true
      },
      "presentation": 
      {
        "echo"  : true,
        "reveal": "always",
        "focus" : true,
        "panel" : "shared"
      },
      "promptOnClose" : true,
      "type"          : "process",
      "osx"           : 
      { 
        "command" : "wine",
        "args"    : 
        [ 
          "/Users/SVG/.wine/drive_c/Program Files/MetaTrader/metaeditor.exe",
          "/compile:${fileBasename}",
          "/log:${fileBasenameNoExtension}.log",
        ]
      },
      "windows"   : 
      { 
        "command" : "C:\\Program Files (x86)\\MetaTrader\\metaeditor.exe",
        "args"    : 
        [ 
          "/compile:${fileBasename}",
          "/log:${fileBasenameNoExtension}.log",
        ]
      },
    }
  ]
}
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64131060

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档