Compilation of MQPROJ project file is weird from command line

 

Hi all,


I have a problem with compiling MQL project files(*.mqproj) from the command line.


I generated a basic a custom indicator using the MetaEditor wizard, and named "macd" (without any modifications).

When compiling it in the MetaEditor IDE itself, it compiles without any errors.

However, when I try to compile it via the command line, I keep getting this error message in the build log:

macd.mqproj : information: compiling 'macd.mqproj'

error 408: source file property "path" is empty.


Can someone please explain to me, why am I getting this error? The project file contains 1 file (only the relevant snippet is shown below):

  "files":
  [
    {
      "path": ".\\macd.mq5",
      "compile": "true",
      "relative_to_project": "true"
    }
  ]

So the path property is clearly not empty.

I used this command to build the indicator (metaeditor64 is in my global path environment variable):

metaeditor64.exe /compile:macd.mqproj /log:build.log

I also tried with the "/project" flag as well:

metaeditor64.exe /compile:macd.mqproj /project /log:build.log

The log file contains the error message I quoted above.

Switching back to the MetaEditor IDE, it compiles just fine from the UI.

It's important for me to compile using the project file, mass compilation of folder is not suitable for my needs.


MetaEditor version: 5.00 build 2885 (14 Apr 2021).


Entering the following command results in:

metaeditor64.exe /?

metaeditor64.exe help

Thanks in advance,

Benjamin

 

I didn't check but I guess "empty" means it didn't find the source file :

      "path": ".\\macd.mq5",

That means the file is searched in the current folder. So try to launch your command from that folder, or update your command to include the correct path.

 
Alain Verleyen:

I didn't check but I guess "empty" means it didn't find the source file :

That means the file is searched in the current folder. So try to launch your command from that folder, or update your command to include the correct path.

Thanks for your comment.


Sadly, the file exists. The project file is in the same folder as the source file.

In fact, it was generated by MetaEditor itself, and uses proper UTF-16 LE encoding.


If I pass the mq5 file instead of the project file to the metaeditor64.exe from the command line, it happily compiles.

I'm thinking this might be a weird JSON-parsing bug. Though interestingly the IDE(UI) parses it correctly.


EDIT: Of course, I'm in the same directory in the command line , where these two files reside (the project and source file).

 

After hours of playing, I can confirm, this is a bug related to parsing the project file properly.

Is there a way to report a bug to the developers themselves?

Service desk doesn't have an option to open a ticket related to metaeditor bugs.

 

Hi there,

did you manage to fix this? I am experiencing the same behaviour when building a mql5 project by Azure Devops Pipeline.

Thanks!

 

The bug is still present in 5.00 Build 3981 under wine.


As far as I can tell, the project file seems valid, I've tried multiple combinations, as well as a file generated from the wizard. They work using the GUI but the CLI build fails:

test.mqproj : information: compiling 'test.mqproj'
(0,0) : error 408: source file property "path" is empty
(1,1) : error 356: event handling function not found
Result: 1 errors, 0 warnings
 
Setting "relative_to_project" to false and using a path relative from the MT5 installation folder seems to work.

I've tried to open a bug report in the Service Desk. Let's see if they provide us with a better work-around, or even better a fix in the next version <3
Reason: