jim lee
Well-known member
Randomly getting this error message. (Yes randomly, changing random things in the source causes it to come and go.)
Here's the error
Here's the code
Adding #include <cstdlib> made if go away for a day. It's uneplicably come back but If I change one atof() to an atoi() it tends to go away.
I know, we all want the simplest code and here I have..
This is giving..
I'm really wondering what I did.
Thanks millions!
-jim lee
Here's the error
Code:
/Applications/Teensyduino.app/Contents/Java/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /Applications/Teensyduino.app/Contents/Java/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libc.a(libc_a-writer.o): in function `_write_r':
(.text._write_r+0x14): undefined reference to `_write'
collect2: error: ld returned 1 exit status
Error compiling for board Teensy 3.2 / 3.1.
Here's the code
Code:
#include <blinker.h>
#include <serialStr.h>
#include <multiMap.h>
#include <cstdlib>
#define OIL_PIN 20
#define TEMP_PIN 21
#define TACH_IN_PIN 22
#define TACH_OUT_PIN 23
#define TACH_START 500
blinker tach(TACH_OUT_PIN);
serialStr serialMgr;
float RPM;
multiMap RPMMapper;
void setup() {
Serial.begin(9600);
serialMgr.setCallback(gotCmd);
/*
RPMMapper.addPoint(0,800);
RPMMapper.addPoint(500,40);
RPMMapper.addPoint(1000,21.5);
RPMMapper.addPoint(1500,12.4);
RPMMapper.addPoint(2000,9.072000);
RPMMapper.addPoint(3000,6.1);
RPMMapper.addPoint(4000,4.57);
RPMMapper.addPoint(0,500);
RPMMapper.addPoint(500,8.5);
RPMMapper.addPoint(1000,4.0);
RPMMapper.addPoint(2000,1.73);
RPMMapper.addPoint(3000,1.18);
RPMMapper.addPoint(4000,0.899);
*/
RPMMapper.addPoint(200,55);
RPMMapper.addPoint(500,22);
RPMMapper.addPoint(1000,10.5);
RPMMapper.addPoint(1500,6);
RPMMapper.addPoint(2000,4.5);
RPMMapper.addPoint(2500,3.65);
RPMMapper.addPoint(3000,3.0);
RPMMapper.addPoint(3500,2.635);
RPMMapper.addPoint(4000,2.27);
setTach(0);
//tach.setOnOff(true);
}
void setTach(float inRPM) {
float outVal;
outVal = RPMMapper.map(inRPM);
if (inRPM>200) {
tach.setPeriod(outVal);
tach.setPercent(50);
if (!tach.running()) {
tach.setOnOff(true);
}
} else {
tach.setOnOff(false);
}
RPM = inRPM;
}
void gotCmd(char* inStr) {
setTach(atof(inStr));
//tach.setPeriod(atof(inStr));
//tach.setPercent(50);
//Serial.println(atof(inStr));
}
void loop() {
idle();
}
Adding #include <cstdlib> made if go away for a day. It's uneplicably come back but If I change one atof() to an atoi() it tends to go away.
I know, we all want the simplest code and here I have..
Code:
void setup() {
float x = atof("4.3");
}
void loop() { }
This is giving..
Code:
forum_post: In function 'void setup()':
forum_post:2: warning: unused variable 'x'
2 | float x = atof("4.3");
| ^
/Applications/Teensyduino.app/Contents/Java/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /Applications/Teensyduino.app/Contents/Java/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libc.a(libc_a-writer.o): in function `_write_r':
(.text._write_r+0x14): undefined reference to `_write'
collect2: error: ld returned 1 exit status
Error compiling for board Teensy 3.2 / 3.1.
I'm really wondering what I did.
Thanks millions!
-jim lee