Help! I don`t know what I am doing wrong…
My project structure:
At Build time, LDF detects all dependencies OK:
LDF: Library Dependency Finder ->
LDF Modes: Finder ~ deep+, Compatibility ~ soft
Found 45 compatible libraries
Scanning dependencies…
Dependency Graph
|-- <MQTT> 2.5.0
|-- <ArduinoJson> 6.19.1
|-- <DHT sensor library> 1.4.3
| |-- <Adafruit Unified Sensor> 1.1.4
|-- <Adafruit Unified Sensor> 1.1.4
|-- <OneWire> 2.3.6
|-- <DallasTemperature> 3.9.1
| |-- <OneWire> 2.3.6
|-- <ESP8266WiFi> 1.0
|-- <sensors>
| |-- <ESP8266WiFi> 1.0
| |-- <DHT sensor library> 1.4.3
| | |-- <Adafruit Unified Sensor> 1.1.4
| |-- <OneWire> 2.3.6
| |-- <DallasTemperature> 3.9.1
| | |-- <OneWire> 2.3.6
|-- <Relay>
| |-- <ESP8266WiFi> 1.0
|-- <IoTServer>
| |-- <ESP8266WiFi> 1.0
| |-- <MQTT> 2.5.0
|-- <IoTDevice>
| |-- <ESP8266WiFi> 1.0
| |-- <sensors>
| | |-- <ESP8266WiFi> 1.0
| | |-- <DHT sensor library> 1.4.3
| | | |-- <Adafruit Unified Sensor> 1.1.4
| | |-- <OneWire> 2.3.6
| | |-- <DallasTemperature> 3.9.1
| | | |-- <OneWire> 2.3.6
| |-- <DHT sensor library> 1.4.3
| | |-- <Adafruit Unified Sensor> 1.1.4
| |-- <OneWire> 2.3.6
| |-- <DallasTemperature> 3.9.1
| | |-- <OneWire> 2.3.6
Building in release mode
afterwords, it seems that all own libraries are successfully compled:
Compiling .pio\build\esp01_1m\lib8bb\sensors\TempSensor.cpp.o
Compiling .pio\build\esp01_1m\libb1a\Relay\Relay.cpp.o
Compiling .pio\build\esp01_1m\lib255\IoTServer\IoTServer.cpp.o
Archiving .pio\build\esp01_1m\lib010\libESP8266WiFi.a
Compiling .pio\build\esp01_1m\lib85a\IoTDevice\IoTDevice.cpp.o
Archiving .pio\build\esp01_1m\lib8bb\libsensors.a
However, at linking, the following messages appear:
Linking .pio\build\esp01_1m\firmware.elf
c:/users/linoprah/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/10.3.0/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01_1m\src\main.cpp.o:(.text._Z17senseAndReportAllv+0x18): undefined reference to _ZN9IoTServer12reportMetricE6Stringf' c:/users/linoprah/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01_1m\src\main.cpp.o: in function
_Z17senseAndReportAllv’:
main.cpp:(.text._Z17senseAndReportAllv+0x4e): undefined reference to _ZN9IoTServer12reportMetricE6Stringf' c:/users/linoprah/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: main.cpp:(.text._Z17senseAndReportAllv+0x7d): undefined reference to
_ZN9IoTServer12reportMetricE6Stringf’
c:/users/linoprah/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/10.3.0/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: main.cpp:(.text._Z17senseAndReportAllv+0x9d): undefined reference to _ZN9IoTServer12reportMetricE6Stringf' c:/users/linoprah/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01_1m\src\main.cpp.o:(.text._Z7connectv+0x30): undefined reference to
_ZN9IotDevice2idEv’
c:/users/linoprah/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/10.3.0/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01_1m\src\main.cpp.o:(.text._Z7connectv+0x34): undefined reference
to _ZN9IoTServer7connectEPKcS1_S1_b' c:/users/linoprah/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01_1m\src\main.cpp.o:(.text._Z7connectv+0x38): undefined reference to
_ZN9IoTServer9subscribeERK6String’
c:/users/linoprah/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/10.3.0/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01_1m\src\main.cpp.o: in function _Z7connectv': main.cpp:(.text._Z7connectv+0x82): undefined reference to
_ZN9IotDevice2idEv’
c:/users/linoprah/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/10.3.0/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: main.cpp:(.text._Z7connectv+0x9f): undefined reference to `_ZN9IoTServer7connectEPKcS1_S1_b’
What am I missing?
I have tried moving the .cpp and .h files around (src, include, lib) in all possible combinations.
I have tried changing lib_ldf_mode
According to my understanding, the /lib folder content should be processed with no additional config. Am I missing a reference to my libraries? Is wo, where and how should they be referenced?
Thank you in advance!
P.D: as suggested by ** maxgerhardt**, I’ve just uploaded the project to GitHub: GitHub - linoprah/home-iot-platformio-q