Error -1073741502 or 0xc0000142 when using "clean" on Windows

You may experience the following error when pressing “clean” in Embeetle:

There is a popup reading The application was unable to start correctly (0xc0000142)

When you click OK, the Embeetle output window shows this error:

make.exe: *** [../config/makefile:244: project/source/Debug/debug.c.o] Error -1073741502

The cause is probably that there is a non-functional unix-like shell on your PATH. One case where we have observed this is on PC’s that have WinAVR installed. The make command in Embeetle picks up that shell and tries to use it to execute commands from the makefile, but fails.

To test, open a cmd command prompt and type where sh.

If there is no shell, you will get INFO: Could not find files for the given pattern(s). In that case, the problem is something else. Please contact us, e.g. reply to this post.

If there is a shell, you will get its location, such as C:\WinAVR-20100110\utils\bin\sh.exe. Type the following command: sh -c rm.

If you get the same popup as in Embeetle, you have found the culprit. The only solution for now is to remove this shell from PATH. Contact us if you need instructions. We are working on a better solution, to make sure that Embeetle always works out-of-the-box.

If the shell is usable, you will get rm: too few arguments. In that case, the problem is something else. Please contact us, e.g. reply to this post.

An easy work-around - easier than editing PATH every time you want to use Embeetle - has been suggested by Timucin Kanatli: rename the WINAVR folder while using Embeetle.

Starting from the next release, Embeetle will automatically remove all PATH entries that contain an executable file sh.exe to avoid this problem.

Note that PATH will only be changed locally in Embeetle and any program started from Embeetle, such as make. You will be able to run WinAVR and Embeetle at the same time, without interference :slight_smile:

A side-effect of this change is that Embeetle will now always use cmd shell commands in the makefile, even if there is a linux-like shell on PATH. This is intended behavior: we want Embeetle to be as independent as possible from other software installed on your PC.

If you really want to use another shell on Windows, you can still do that by requesting that shell explicitly in the Makefile. For example, if you have MSYS2 installed at C:\msys64, add the following lines somewhere near the beginning of your project's makefile`:

ifeq ($(SHELL),sh.exe)
export SHELL = C:/msys64/usr/bin/sh.exe
PATH := C:/msys64/usr/bin;$(PATH)
endif
1 Like

Hi,
Worked for me
Thanks

2 Likes