# Permission denied while compiling (Arduino/ESP)

**URL:** <https://forum.arduino.cc/t/permission-denied-while-compiling-arduino-esp/1071316>\
**Category:** IDE 1.x\
**Created:** [December 30, 2022, 5:07pm UTC](https://forum.arduino.cc/t/permission-denied-while-compiling-arduino-esp/1071316 "2022-12-30T17:07:06Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike93](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@Mike93](https://forum.arduino.cc/u/Mike93)\
**Post date:** [December 30, 2022, 5:07pm UTC](https://forum.arduino.cc/t/permission-denied-while-compiling-arduino-esp/1071316/1 "2022-12-30T17:07:06Z")

</div>

Hi,

I'm using a Mac with macOS 13.1 Ventura. When I want to compile a sketch I get the following error message:

Arduino: 1.8.19 (Mac OS X), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 16KB cache + 48KB IRAM (IRAM), Use pgm\_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, All Flash Contents, 921600"

fork/exec /Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/xtensa-lx106-elf-g++: permission denied  
Fehler beim Kompilieren für das Board NodeMCU 1.0 (ESP-12E Module).

The folder "portable" contains the ArduBlock stuff and it worked 2 years ago but now it cannot be accessed. I tried going around gatekeeper, I checked the permissions with CMD+I on the files but I have r/w access.

Is there someone who can help with this?

Wishes

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [December 30, 2022, 5:49pm UTC](https://forum.arduino.cc/t/permission-denied-while-compiling-arduino-esp/1071316/2 "2022-12-30T17:49:40Z")

</div>

Can you change the privileges to the app/folder causing the permission issue? (maybe you want uninstall and reinstall as "user.")

---

<div class="post-metadata">

**Author:** ![Mike93](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@Mike93](https://forum.arduino.cc/u/Mike93)\
**Post date:** [December 30, 2022, 5:56pm UTC](https://forum.arduino.cc/t/permission-denied-while-compiling-arduino-esp/1071316/3 "2022-12-30T17:56:02Z")

</div>

I tried it for the file mentioned in the error message but the message didn't change.

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [December 30, 2022, 9:55pm UTC](https://forum.arduino.cc/t/permission-denied-while-compiling-arduino-esp/1071316/4 "2022-12-30T21:55:54Z")

</div>

Try changing permissions to the folder.

---

<div class="post-metadata">

**Author:** ![Mike93](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@Mike93](https://forum.arduino.cc/u/Mike93)\
**Post date:** [December 31, 2022, 3:27pm UTC](https://forum.arduino.cc/t/permission-denied-while-compiling-arduino-esp/1071316/5 "2022-12-31T15:27:15Z")

</div>

I changed the way I checked the permissions: I used the terminal with "ls -l" and changed the permissions via terminal as well (sudo chmod -R 755 /Applications/Arduino.app/Contents/Java/portable/).

Very nice that the cmd+I shows not the whole permissions of files and folders. Anyway, I have another error message that isn't clear to me:

```cpp
/Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: /Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so: error loading plugin: dlopen(/Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so, 0x0002): tried: '/Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so' (not a mach-o file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so' (no such file), '/Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/bin/../libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so' (not a mach-o file), '/Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so' (not a mach-o file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so' (no such file), '/Applications/Arduino.app/Contents/Java/portable/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so' (not a mach-o file)
collect2: error: ld returned 1 exit status

exit status 1
Fehler beim Kompilieren für das Board NodeMCU 1.0 (ESP-12E Module).

```

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [December 31, 2022, 4:13pm UTC](https://forum.arduino.cc/t/permission-denied-while-compiling-arduino-esp/1071316/6 "2022-12-31T16:13:32Z")

</div>

This ([link](https://stackoverflow.com/questions/48744967/otool-l-not-a-mach-o-filetype)) describes this error, and maybe the solution.

FYI: When pasting computer output, enclose it in the code tag **\</\>** for easier reading.

---

<div class="post-metadata">

**Author:** ![Mike93](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@Mike93](https://forum.arduino.cc/u/Mike93)\
**Post date:** [January 1, 2023, 8:20am UTC](https://forum.arduino.cc/t/permission-denied-while-compiling-arduino-esp/1071316/7 "2023-01-01T08:20:36Z")

</div>

Hi,  
thanks for the link. The links in the thread are dead so it wasn't directly helpful. I got some new words for a google research but it wasn't helping as well.

Even an empty sketch like

```cpp
void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

```

cannot be compiled. The error message is the same as I get for my sketch.

Wishes & happy new year

---

<div class="post-metadata">

**Author:** ![lj001](https://avatars.discourse-cdn.com/v4/letter/l/96bed5/32.png) [@lj001](https://forum.arduino.cc/u/lj001)\
**Post date:** [January 17, 2023, 11:10am UTC](https://forum.arduino.cc/t/permission-denied-while-compiling-arduino-esp/1071316/8 "2023-01-17T11:10:18Z")

</div>

I upgraded to Arduino 2.\* and tried to compile a simple hello world sketch I had and got the same error:

```cpp
fork/exec /Users/lj/Library/Arduino15/packages/smartwatch-boards/hardware/nRF5/0.1.3/tools/adafruit-nrfutil/adafruit-nrfutil: permission denied

Compilation error: fork/exec /Users/lj/Library/Arduino15/packages/smartwatch-boards/hardware/nRF5/0.1.3/tools/adafruit-nrfutil/adafruit-nrfutil: permission denied

```

---

<div class="post-metadata">

**Author:** ![lj001](https://avatars.discourse-cdn.com/v4/letter/l/96bed5/32.png) [@lj001](https://forum.arduino.cc/u/lj001)\
**Post date:** [January 17, 2023, 12:49pm UTC](https://forum.arduino.cc/t/permission-denied-while-compiling-arduino-esp/1071316/9 "2023-01-17T12:49:13Z")

</div>

Did a `chmod -R 777 Arduino15` which solved the problem

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [January 17, 2023, 3:57pm UTC](https://forum.arduino.cc/t/permission-denied-while-compiling-arduino-esp/1071316/10 "2023-01-17T15:57:53Z")

</div>

You should make sure to update the adafruit-nrfutil tool you distribute with your "smartwatch-boards" platform so that it has the required executable permissions when installed. That way, the users won't suffer from the same error.

---

<div class="post-metadata">

**Author:** ![Mike93](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@Mike93](https://forum.arduino.cc/u/Mike93)\
**Post date:** [January 17, 2023, 5:23pm UTC](https://forum.arduino.cc/t/permission-denied-while-compiling-arduino-esp/1071316/11 "2023-01-17T17:23:29Z")

</div>

Yes, this is what I did to solve the permission problem. The GUI of macOS is not giving you full permission control or at least on a more basic level compared to the past.

Anyway, anybody knows something about this "mach-o file" error message?

`xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/libexec/gcc/xtensa-lx106-elf/10.3.0/liblto_plugin.so' (not a mach-o file) collect2: error: ld returned 1 exit status exit status 1`

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [January 17, 2023, 6:05pm UTC](https://forum.arduino.cc/t/permission-denied-while-compiling-arduino-esp/1071316/12 "2023-01-17T18:05:21Z")

</div>

> [@Mike93](#):
>
> anybody knows something about this "mach-o file" error message?

I see you are using a fairly outdated version of the ESP8266 boards platform. The problem may have been solved in a later version, which uses a newer **xtensa-lx106-elf-gcc** compiler.

Unless you are using that version of the ESP8266 boards platform for a specific reason, I recommend you update to the latest version:

1. Select **Tools \> Board \> Boards Manager** from the Arduino IDE menus.
2. Wait for the updates to finish.
3. Scroll down through the list of boards platforms until you see the " **esp8266 by ESP8266 Community**" entry. Click on it.
4. Click the **Update** button.
5. Wait for the update to finish.
6. Click the **Close** button.

Now try compiling your sketch again. Hopefully the error will no longer occur.

---

<div class="post-metadata">

**Author:** ![Mike93](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@Mike93](https://forum.arduino.cc/u/Mike93)\
**Post date:** [January 18, 2023, 3:59pm UTC](https://forum.arduino.cc/t/permission-denied-while-compiling-arduino-esp/1071316/13 "2023-01-18T15:59:12Z")

</div>

Hi,  
thanks, that helped. I didn't check it and well, you are right. Thanks.

---

<div class="post-metadata">

**Author:** ![ptillisch](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@ptillisch](https://forum.arduino.cc/u/ptillisch)\
**Post date:** [January 19, 2023, 1:46am UTC](https://forum.arduino.cc/t/permission-denied-while-compiling-arduino-esp/1071316/14 "2023-01-19T01:46:46Z")

</div>

You are welcome. I'm glad it is working now.

Regards,  
Per

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 18, 2023, 1:47am UTC](https://forum.arduino.cc/t/permission-denied-while-compiling-arduino-esp/1071316/15 "2023-07-18T01:47:45Z")

</div>

Closed on July 18, 2023, 1:47am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
