# Need help with undefined reference

**URL:** <https://forum.arduino.cc/t/need-help-with-undefined-reference/1038168>\
**Category:** General Guidance\
**Created:** [October 4, 2022, 3:40am UTC](https://forum.arduino.cc/t/need-help-with-undefined-reference/1038168 "2022-10-04T03:40:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![swanny21364](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@swanny21364](https://forum.arduino.cc/u/swanny21364)\
**Post date:** [October 4, 2022, 3:40am UTC](https://forum.arduino.cc/t/need-help-with-undefined-reference/1038168/1 "2022-10-04T03:40:42Z")

</div>

#include "ServoEasing.h"

ServoEasing servoTop;

ServoEasing servoBottom;

const int action\_pin = 2;

const int ledPin = 6;

const int potPin = A0;

int location = 31;

int bottom\_closed = 107;

int top\_closed = 167;

int bottom\_open = 20;

int top\_open = 20;

int value;

int maxBrightness;

void setup() {

pinMode(action\_pin, INPUT\_PULLUP);

pinMode(potPin, INPUT);

servoTop.attach(9);

servoBottom.attach(10);

setSpeedForAllServos(190);

servoTop.setEasingType(EASE\_CUBIC\_IN\_OUT);

servoBottom.setEasingType(EASE\_CUBIC\_IN\_OUT);

synchronizeAllServosStartAndWaitForAllServosToStop();

}

void loop() {

value = analogRead(potPin);

maxBrightness = map(value, 250, 750, 0, 255);

int proximity = digitalRead(action\_pin);

if (proximity == LOW)

{

if (location \> bottom\_open) {

servoTop.setEaseTo(top\_open);

servoBottom.setEaseTo(bottom\_open);

synchronizeAllServosStartAndWaitForAllServosToStop();

location = bottom\_open;

delay(10);

analogWrite(ledPin, 0);

} else {

servoTop.setEaseTo(top\_closed);

servoBottom.setEaseTo(bottom\_closed);

synchronizeAllServosStartAndWaitForAllServosToStop();

location = bottom\_closed;

delay(50);

analogWrite(ledPin, maxBrightness / 3);

delay(100);

analogWrite(ledPin, maxBrightness / 5);

delay(100);

analogWrite(ledPin, maxBrightness / 2);

delay(100);

analogWrite(ledPin, maxBrightness / 3);

delay(100);

analogWrite(ledPin, maxBrightness);

delay(100);

}

}

}

C:\Users\Tswan\AppData\Local\Temp\ccVZVXHo.ltrans0.ltrans.o: In function `setup': C:\Users\Tswan\OneDrive\Documents\Arduino\sketch_oct3i/sketch_oct3i.ino:18: undefined reference to `ServoEasing::attach(int)'  
C:\Users\Tswan\OneDrive\Documents\Arduino\sketch\_oct3i/sketch\_oct3i.ino:19: undefined reference to `ServoEasing::attach(int)' C:\Users\Tswan\OneDrive\Documents\Arduino\sketch_oct3i/sketch_oct3i.ino:20: undefined reference to `setSpeedForAllServos(unsigned int)'  
C:\Users\Tswan\OneDrive\Documents\Arduino\sketch\_oct3i/sketch\_oct3i.ino:21: undefined reference to `ServoEasing::setEasingType(unsigned char)' C:\Users\Tswan\OneDrive\Documents\Arduino\sketch_oct3i/sketch_oct3i.ino:22: undefined reference to `ServoEasing::setEasingType(unsigned char)'  
C:\Users\Tswan\OneDrive\Documents\Arduino\sketch\_oct3i/sketch\_oct3i.ino:23: undefined reference to `synchronizeAllServosStartAndWaitForAllServosToStop()' C:\Users\Tswan\AppData\Local\Temp\ccVZVXHo.ltrans0.ltrans.o: In function `loop':  
C:\Users\Tswan\OneDrive\Documents\Arduino\sketch\_oct3i/sketch\_oct3i.ino:33: undefined reference to `ServoEasing::setEaseTo(int)' C:\Users\Tswan\OneDrive\Documents\Arduino\sketch_oct3i/sketch_oct3i.ino:34: undefined reference to `ServoEasing::setEaseTo(int)'  
C:\Users\Tswan\OneDrive\Documents\Arduino\sketch\_oct3i/sketch\_oct3i.ino:35: undefined reference to `synchronizeAllServosStartAndWaitForAllServosToStop()' C:\Users\Tswan\OneDrive\Documents\Arduino\sketch_oct3i/sketch_oct3i.ino:40: undefined reference to `ServoEasing::setEaseTo(int)'  
C:\Users\Tswan\OneDrive\Documents\Arduino\sketch\_oct3i/sketch\_oct3i.ino:41: undefined reference to `ServoEasing::setEaseTo(int)' C:\Users\Tswan\OneDrive\Documents\Arduino\sketch_oct3i/sketch_oct3i.ino:42: undefined reference to `synchronizeAllServosStartAndWaitForAllServosToStop()'  
C:\Users\Tswan\AppData\Local\Temp\ccVZVXHo.ltrans0.ltrans.o: In function `_GLOBAL__sub_I_servoTop': C:\Users\Tswan\OneDrive\Documents\Arduino\sketch_oct3i/sketch_oct3i.ino:2: undefined reference to `ServoEasing::ServoEasing()'  
C:\Users\Tswan\OneDrive\Documents\Arduino\sketch\_oct3i/sketch\_oct3i.ino:3: undefined reference to `ServoEasing::ServoEasing()'  
collect2.exe: error: ld returned 1 exit status

exit status 1

Compilation error: exit status 1

---

<div class="post-metadata">

**Author:** ![killzone\_kid](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/killzone_kid/32/1098074_2.png) [@killzone\_kid](https://forum.arduino.cc/u/killzone_kid)\
**Post date:** [October 4, 2022, 4:06am UTC](https://forum.arduino.cc/t/need-help-with-undefined-reference/1038168/2 "2022-10-04T04:06:25Z")

</div>

you haven’t added files properly to your project most likely, give more details

---

<div class="post-metadata">

**Author:** ![paulpaulson](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulpaulson/32/363643_2.png) [@paulpaulson](https://forum.arduino.cc/u/paulpaulson)\
**Post date:** [October 4, 2022, 4:28am UTC](https://forum.arduino.cc/t/need-help-with-undefined-reference/1038168/3 "2022-10-04T04:28:52Z")

</div>

Hello [swanny21364](https://forum.arduino.cc/u/swanny21364)

You may start with a tutorial how to use the mentioned libary to gain the knowledge how to.

---

<div class="post-metadata">

**Author:** ![gilshultz](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gilshultz](https://forum.arduino.cc/u/gilshultz)\
**Post date:** [October 4, 2022, 5:13am UTC](https://forum.arduino.cc/t/need-help-with-undefined-reference/1038168/4 "2022-10-04T05:13:44Z")

</div>

Read the forum guidelines and post the code accordingly.

---

<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:** [April 2, 2023, 5:14am UTC](https://forum.arduino.cc/t/need-help-with-undefined-reference/1038168/5 "2023-04-02T05:14:24Z")

</div>

Closed on April 2, 2023, 5:14am UTC

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