Export Compiled Binary

Code actually compiles and works but gives this error. Any thoughts??

Sketch uses 1581084 bytes (80%) of program storage space. Maximum is 1966080 bytes.
Global variables use 61600 bytes (18%) of dynamic memory, leaving 266080 bytes for local variables. Maximum is 327680 bytes.
At line:1 char:255

  • ... ':')[0..2] -join '.'; $dest='C:\Users\garry\OneDrive\Garry's Stuff\D ...
  •                                                             ~
    

Unexpected token 's' in expression or statement.
At line:1 char:605

  • ... 9AFB7B\Final_I2C_Hydroponics_Controller_V11.ino.*' -Destination $dest
  •                                                  ~~~~~~~~~~~~~~~~~~~~
    

The string is missing the terminator: '.

  • CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
  • FullyQualifiedErrorId : UnexpectedToken

exit status 1

Compilation error: exit status 1

1. Which Arduino, IDE and sketch are you using?

2. Normally, you create sketch and upload it -- why are you performing Export Compiled Binary task?

The IDE isn't liking the embedded "'" in the path would be my first guess.

Try greatly shortening that dest path by making a temp folder closer to root and copy the needed files into that.

I use OTA for updating the Software

2.3.8

The path contains a " ' " which is also used as a terminator. Anything beyond that will not be interpreted correctly.

So, I am a little confused this has always worked without errors until now.

I have not changed where the file goes at all, is this an Arduino Compiler error since the IDE was upgraded and I need to advise the developers?

Garry

Hi @gjb17.

My guess is that it would be considered a bug in the platform of the board you are using. The developers of that platform may well have introduced a bug in a recent version of the platform, thus causing a regression in the functionality in this specific usage after you updated to that version of the platform.

You haven't specified which board and platform you are using, so that makes it difficult for us to investigate the situation.

I'm going to ask you to provide the full verbose output from an "Export Compiled Binary" attempt.


:red_exclamation_mark: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Open the sketch in Arduino IDE.
  2. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  3. Check the box next to "Show verbose output during: ☐ compile" in the "Preferences" dialog.
  4. Click the "OK" button.
    The "Preferences" dialog will close.
  5. Select Sketch > Export Compiled Binary from the Arduino IDE menus.
  6. Wait for the operation to fail.
  7. You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  8. Open a reply here on this forum topic by clicking the "Reply" button.
  9. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
  10. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the compilation output into the code block.
  11. Move the cursor outside of the code block markup before you add any additional text to your reply.
  12. Click the "Reply" button to publish the post.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here.

Click here for attachment instructions

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a reply here on this forum topic by clicking the "Reply" button.
  5. Click the "Upload" icon (Upload icon) on the post composer toolbar:

    The "Open" dialog will open.
  6. Select the .txt file you saved from the "Open" dialog.
  7. Click the "Open" button.
    The dialog will close.
  8. Click the "Reply" button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.


Compilation Error.txt (856.0 KB)

Confirms what i said.

powershell -Command "$env:FQBN_DIR=('esp32:esp32:esp32wroverkit:UploadSpeed=921600,CPUFreq=240,FlashFreq=80,FlashMode=qio,FlashSize=4M,PartitionScheme=min_spiffs,DebugLevel=none,PSRAM=enabled,EraseFlash=none' -split ':')[0..2] -join '.'; $dest='C:\\Users\\garry\\OneDrive\\Garry's Stuff\\Documents\\Arduino\\I2C_Hydroponics_Controller\\Final_I2C_Hydroponics_Controller_V11\\build\\' + $env:FQBN_DIR; New-Item -ItemType Directory -Force -Path $dest | Out-Null; Copy-Item -Force -ErrorAction SilentlyContinue -Path 'C:\\Users\\garry\\AppData\\Local\\arduino\\sketches\\C1AF195EE9195BE567AE1A6B049AFB7B\\Final_I2C_Hydroponics_Controller_V11.ino.*' -Destination $dest"
At line:1 char:255
+ ...  ':')[0..2] -join '.'; $dest='C:\Users\garry\OneDrive\Garry's Stuff\D ...
+                                                                 ~
Unexpected token 's' in expression or statement.

Back in post #3 I said it was the embedded " ' " in the command. And the full error log supports that. And if you look at the powershell command above it, that shows it clear as day.

$dest='C:\\Users\\garry\\OneDrive\\Garry's Stuff\\Documents\\Arduino\\I2C_Hydroponics_Controller\\Final_I2C_Hydroponics_Controller_V11\\build\\' + $env

$dest is assigned a path enclosed in single quotes. And there's a single quote in the path itself. You can't do that. Either change the command or change the path.

This isn't rocket science folks. Look at the error message which tells you what the problem is, look at the command string to see where the problem is, then fix it. Changing the path to take out the embedded single quote is likely the easiest thing.

Hi,

Thank you for your reply.

It basically means nothing to me. i am an amateur coder who when he presses the Compile/Upload/Export Compiled Binary Function I expect it to work, If there is an error in my code so be it. I fix it and redo the action. I do not know where to even go to fix this as I expect the "function" in Arduino IDE to just work and don't understand the underlying code of the Function.

Anyway thank you for your help and description but I will just have to live with it as the code at least compiles and works anyway.

Garry

Rename the offending directory in the path. Take the ' out of it. It's a 10 second fix!

This was one of the items of information I was interested in extracting from the "Export Compiled Binary" output:

This tells us you are using the 3rd party "esp32" boards platform. Each boards platform can configure the commands Arduino IDE should invoke when performing operations such as "Export Compiled Binary". This is done by defining templates, which Arduino IDE populates. The templates for the commands invoked when performing an "Export Compiled Binary" when an ESP32-based board is selected are defined here:


The other piece of information I was interested in extracting was the full command that failed. @van_der_decken has provided analysis of that information in post #12.

Hi,

OK, I get it finally.

Because the folder is accessed by other programs, I copied the folder closer to Root, changed the name of the folder and edited the path under Preferences to point to the Folder. Now fully Compiles/Exports without showing any errors.

Thanks to all involved