I’ve been scouring the internet trying to find a solution and done a ton of tinkering myself, but at this point, I’ve lost all my hair and feel no closer to solving this problem.
Here’s the error:
Linking .pio\build\megaatmega2560\firmware.elf
C:\Users\matth\AppData\Local\Temp\cclHZ2N6.ltrans0.ltrans.o: In function `_GLOBAL__sub_I_selectWheel':
<artificial>:(.text.startup+0xf6): undefined reference to `SelectWheel::SelectWheel()'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\megaatmega2560\firmware.elf] Error 1
Here’s the terminal output for pio run -t clean
and platformio run --verbose
: Platformio Clean and Build Terminal - Pastebin.com
Here’s the project structure:
Hydro9000
| -- .pio
| -- .vscode
| -- include
| | -- Adafruit_BusIO
| | -- Adafruit_EPD
| | -- Adafruit_GFX_Library
| | -- Adafruit_SSD1306
| | -- ArduinoSTL
| -- lib
| | -- SelectWheel
| | | -- SelectWheel.h
| | | -- SelectWheel.cpp
| -- src
| | -- main.cpp
| -- platformio.ini
Here’s platformio.ini
[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
Here’s /src/main.cpp
#include <Arduino.h>
#include "SelectWheel/SelectWheel.h"
SelectWheel* selectWheel = new SelectWheel();
void setup() {}
void loop() {}
Here’s /lib/SelectWheel/SelectWheel.h
#ifndef SelectWheel_h
#define SelectWheel_h
#include "Arduino.h"
class SelectWheel {
private:
int pinA, pinB;
public:
SelectWheel();
SelectWheel(int, int);
};
#endif
Here’s /lib/SelectWheel/SelectWheel.cpp
#include "SelectWheel.h"
SelectWheel::SelectWheel() {}
SelectWheel::SelectWheel(int pinA, int pinB) {
this->pinA = pinA;
this->pinB = pinB;
pinMode(this->pinA, INPUT);
pinMode(this->pinB, INPUT);
}
Let me know if there is any additional information I can supply to help as I’ve already tried a bunch of way to fix this.