Error compiling: linker_script.ld: No such file or directory


I am stumped trying to solve this error. The script worked fine before but I now get this error when trying to compile. I cannot find any details on how to resolve. I've tried a clean install as well but still get this error. All boards and libraries are up to date.

arm-none-eabi-g++: error: Muir\AppData\Local\Temp\arduino_build_813034/linker_script.ld: No such file or directory
exit status 1
Error compiling for board Arduino Portenta H7 (M7 core).

IDE: 1.8.16
Device: Portenta H7
IDE Board: Arduino MBED OS Portenta Boards > Arduino Portenta H7 (M7 Core)
Flash Split: 1MB M7 + 1MB M4
Programmer: ARM CMSIS-DAP Compatible

@Roy86, although there basically is nothing wrong with where you posted your question, it has been moved to the Portenta section of the forum where it hopefully attracts the attention of those more familiar with the Portenta.

I'm not one of those, but have you verified that the linker_script.ld indeed exists in the given location?

Hi @Roy86. I notice that path Muir\AppData\Local\Temp\arduino_build_813034/linker_script.ld appears to be only partial. Do you have a space in your Windows user name?

Hi sterretje,

Thanks for moving :slight_smile: It appears as a temporary space each time I click compile. So when I check it, the folder is created but once an error occurs or completes, it doesn't exist anymore.

Hi in0
Yes I do but I can't seem to repoint the compiler to a non-user temporary folder to prevent the issue.

This was a default installation with the arduino 1.8.16.exe installer.

Yeah, that is a tricky thing. You can change all the other paths used by the Arduino IDE fairly easily, but not so much when it comes to the temporary build folder location.

Please try this experiment:

  1. Select File > New from the Arduino IDE menus.
    This is just to get an arbitrary sketch open for the experiment.
  2. Select Tools > Board > Arduino AVR Boards > Arduino Uno from the Arduino IDE menus.
  3. Select Sketch > Verify/Compile from the Arduino IDE menus.
  4. Wait for the compilation to finish or fail.

Does the same error occur when compiling for the Uno? The reason for the experiment is to determine whether the problem is with the Arduino IDE itself, or with the "Arduino Mbed OS Portenta Boards" platform you were using to compile when you had the error.

I could in theory run the experiment myself, but my Windows user name doesn't happen to contain a space and I'd prefer not to go to the trouble of creating a new one.

Hi Ino,

Thanks very much and happy to test these. The sketch compiles without issue with the Arduino Uno Board.

Interestingly I get a different error with different options
Tools > Board > Arduino AVR Boards > Arduino Uno - Completed, no errors
Tools > Board > Arduino Mbed OS Nano Boards > Arduino Nano 33 BLE - Error Linker_script.ld: No such file
Tools > Board > Arduino Mbed OS Portenta Boards > Arduino Portenta H7 (M7 Core) - Error Linker_script.ld: No such file
Tools > Board > Arduino Mbed OS Boards > Arduino Portenta H7 (M7 Core) - Error with Wire Library (see below). If I remove the wire library and the Wire.Begin() command, it compiles fine.

In file included from C:\Users\First Last\AppData\Local\Temp\arduino_modified_sketch_814616\sketch_nov25b.ino:2:0:
C:\Users\First Last\AppData\Local\Arduino15\packages\arduino\hardware\mbed\2.1.0\libraries\Wire/Wire.h:35:1: error: expected class-name before '{' token
C:\Users\First Last\AppData\Local\Arduino15\packages\arduino\hardware\mbed\2.1.0\libraries\Wire/Wire.h:64:18: error: type 'arduino::Print' is not a base type for type 'arduino::MbedI2C'
     using Print::write;
exit status 1
Error compiling for board Arduino Portenta H7 (M7 core).

Thanks. That put me on the right path. There is some missing quoting in the Arduino Mbed OS platform configuration that makes it incompatible with paths that have spaces.

There is a proposal for a fix here:

You can see the necessary change here:
You can make that patch on your local installation of the platforms right now for an immediate fix to the error. I can provide instructions if you want assistance with that.

I guess the reason is that you have an older version of this particular boards platform from before the bug was introduced in version 2.6.1:


Hi in0,

That is awesome, thank you very much for all your help. I was at a standstill till I could fix this.

I've used the details from that ArduinoCore-mbed Git Link to replace the strings in all the platform.txt files and included the quotation marks based on that change.

This has resolved the issue by the looks of it and I can now compile properly with the wire library as well.

Thank you!

1 Like

You are welcome. I'm glad to hear it is working now!
The fix will be in the next release of the Arduino Mbed OS Boards platforms, so the manual patch should only be needed for this single 2.6.1 release of the platforms.

1 Like

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