Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Missing reference to _write in Release build (Read 255 times)
Cody Barnes
Newbies
*
Offline


Posts: 1
Joined: Sep 7th, 2020
Missing reference to _write in Release build
Oct 13th, 2025 at 8:13pm
Print Post  
I'm looking for some help with problem with the linker being unable to locate the _write method in a release build only. 

I'm working on an older project (last built in 2019) that I can't seem to get to build in the Release configuration. No problems with the Debug configuration. The error is:

ld.exe: .o): in function _write_r

Error linking for board Teensy 3.2 / 3.1 (teensy31)
(.text._write_r+0x14)*: undefined reference to _write
Build failed for project 'Eyedrivomatic.Firmware.Delta'

I have the "Arduino 2" IDE selected with the default locations. I've tried re-installing the Teensy board files. Am I missing a library location? If so, where would I specify it?

Note: the build output shows that I am using a trial version. However, I was using a licensed version the last time I built this project. I fully intend to renew my license assuming I can get this to build again.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2807
Joined: Feb 13th, 2019
Re: Missing reference to _write in Release build
Reply #1 - Oct 14th, 2025 at 8:44am
Print Post  
Thanks for the report, could you attach the log from a successful debug build as well so we can compare them?
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2807
Joined: Feb 13th, 2019
Re: Missing reference to _write in Release build
Reply #2 - Oct 20th, 2025 at 1:33pm
Print Post  
From the behavior it seems that there are calls to e.g. Serial.printf() in your code, but there is no corresponding Serial.begin() or Serial.print().

When the Serial debugger is enabled, these are automatically injected at build time which will be pulling in the required implementations of _write for the linker.  When it is disabled they aren't added, and if not present in your INO code then the linker fails to find them.

If this is not the case, can you ZIP your project and email it to us? (omit the .vs folder for space saving).
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2807
Joined: Feb 13th, 2019
Re: Missing reference to _write in Release build
Reply #3 - Oct 21st, 2025 at 12:07pm
Print Post  
Thanks for the project, and if I add the Serial.begin and a println statement to Setup() as below, then clean the project and rebuild it, it compiles as expected.

e.g.
Code
Select All
void setup()
{
Serial.begin(115200);
Serial.println("Im Alive");
... 



Hopefully this resolves this issue on your side as well, and at least this doesn't need to have any compiler flags changing so zero real impact on functionality.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint