politoleo / iar

IAR Embedded Workbench Visual Studio Code Extension
22 stars 17 forks source link

Error on running build: "Error while starting IarBuild.exe." #6

Closed apullin closed 6 years ago

apullin commented 6 years ago

I am hitting an error when trying to run a build:

Building configuration: Debug
Error while starting IarBuild.exe. Open it with IAR Ide to fix it.
Something went wrong...

The workspace settings.json is:

{
    "iar.enabled":true
}

and then my iar.json is:

{
    "iar.enabled":true,
    "version": 1,
    "path": "C:\\Program Files (x86)\\IAR Systems\\Embedded Workbench 8.0\\",
    "project":  "C:\\path\\to\\my\\project\\project1\\myproj.ewp",
    "config": "Debug",
    "verbose": true
}

One note is that my workspace root is C:\\path\\to\\my\\project\\, where I have an EWT file with several subdirs, each with their own EWP and code, and one for common code between the IAR projects. I am sure that the "project" option is correct, since I can copy and paste it into a command line, unescape it, and prepend it with dir, and the file exists.

If I open a new VSCode window and open it to the root of the directory the project is in, and use the same iar.json and settings.json, then it will successfully build. Due to the use of the common code dir, I would really prefer to get this working using VSCode open in the EWT root.

I am sure it is something obvious and simple, but I can't figure it out, and I am eager to move away from the IAR editor entirely.

politoleo commented 6 years ago

I use the same setup as yours, where ".ewp" is inside a subdir, this is mine for reference:

{
    "version": 1,
    "path": "C:\\Program Files (x86)\\IAR Systems\\Embedded Workbench 7.4\\",
    "project": "${workspaceRoot}\\project\\EBMC.ewp",
    "config": "Debug"
}

Could you try to use "workspaceRoot" instead of the absolute path?

politoleo commented 6 years ago

Also, I'm assuming "config" is right, in your case it should be "Debug" too. img