Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile Minimal from platformio #5

Closed
fermuch opened this issue Nov 25, 2019 · 5 comments
Closed

Can't compile Minimal from platformio #5

fermuch opened this issue Nov 25, 2019 · 5 comments

Comments

@fermuch
Copy link

fermuch commented Nov 25, 2019

Hello!

I'm trying to load the library from platformio, but I get the following error:

Linking .pio/build/esp32doit-devkit-v1/firmware.elf
.pio/build/esp32doit-devkit-v1/src/main.ino.cpp.o:(.literal._Z5setupv+0x2c): undefined reference to `mDashInit'
.pio/build/esp32doit-devkit-v1/src/main.ino.cpp.o: In function `setup()':
/home/fermuch/Documentos/Dev/Work/AYVU/test-esp32/src/main.ino:26: undefined reference to `mDashInit'
collect2: error: ld returned 1 exit status
*** [.pio/build/esp32doit-devkit-v1/firmware.elf] Error 1

The sketch is the following:

#define MDASH_APP_NAME "MinimalApp"
#include <mDash.h>

#include <WiFi.h>

#define WIFI_NETWORK "MyWifiNetworkName"
#define WIFI_PASSWORD "MyWifiPassword"
#define DEVICE_PASSWORD "mDashDeviceToken"

void setup() {
  Serial.begin(115200);
  WiFi.begin(WIFI_NETWORK, WIFI_PASSWORD);
  mDashBegin(DEVICE_PASSWORD);
}

void loop() {
  delay(100);
}

And finally this is the platformio.ini file:

[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
lib_deps =
  https://github.com/cesanta/mDash.git

(It also doesn't work if I use a release instead of pulling from git)

@fermuch
Copy link
Author

fermuch commented Nov 25, 2019

Seems like the lib is not auto-loaded. Adding the following to platformio.ini solves the problem:

build_flags = -L.pio/libdeps/esp32doit-devkit-v1/mDash/src/esp32/ -llibmDash

@RobinsonLaw
Copy link

also didn't work

@cpq
Copy link
Member

cpq commented Sep 3, 2020

Please see #8

@cpq cpq closed this as completed Sep 3, 2020
@yeckel
Copy link

yeckel commented May 4, 2021

Just tested it with newest version of libraries and just the solution:
build_flags = -L.pio/libdeps/<name of the lib>/mDash/src/esp32/ -llibmDash
works. The solution by @cpq does not althoug the PR he is mentioning is already there.

@sandikodev
Copy link

right, adding
build_flags = -L.pio/libdeps/esp32doit-devkit-v1/mDash/src/esp32/ -llibmDash

works like a charm

platformio.ini

[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
build_flags = -L.pio/libdeps/esp32doit-devkit-v1/mDash/src/esp32/ -llibmDash
lib_deps = cesanta/mDash@^1.2.14

pio run -e esp32doit-devkit-v1

Processing esp32doit-devkit-v1 (platform: espressif32; board: esp32doit-devkit-v1; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 (3.1.0) > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 3.10005.210308 (1.0.5) 
 - tool-esptoolpy 1.30000.201119 (3.0.0) 
 - toolchain-xtensa32 2.50200.97 (5.2.0)
Converting main.ino
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <mDash> 1.2.14
|-- <WiFi> 1.0
Building in release mode
Compiling .pio/build/esp32doit-devkit-v1/src/main.ino.cpp.o
Generating partitions .pio/build/esp32doit-devkit-v1/partitions.bin
Archiving .pio/build/esp32doit-devkit-v1/lib24b/libmDash.a
Indexing .pio/build/esp32doit-devkit-v1/lib24b/libmDash.a
Compiling .pio/build/esp32doit-devkit-v1/lib0a0/WiFi/ETH.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/lib0a0/WiFi/WiFi.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/lib0a0/WiFi/WiFiAP.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/lib0a0/WiFi/WiFiClient.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/lib0a0/WiFi/WiFiGeneric.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/lib0a0/WiFi/WiFiMulti.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/lib0a0/WiFi/WiFiSTA.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/lib0a0/WiFi/WiFiScan.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/lib0a0/WiFi/WiFiServer.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/lib0a0/WiFi/WiFiUdp.cpp.o
Archiving .pio/build/esp32doit-devkit-v1/libFrameworkArduinoVariant.a
Indexing .pio/build/esp32doit-devkit-v1/libFrameworkArduinoVariant.a
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/Esp.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/FunctionalInterrupt.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/HardwareSerial.cpp.o
Archiving .pio/build/esp32doit-devkit-v1/lib0a0/libWiFi.a
Indexing .pio/build/esp32doit-devkit-v1/lib0a0/libWiFi.a
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/IPAddress.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/IPv6Address.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/MD5Builder.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/Print.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/Stream.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/StreamString.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/WMath.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/WString.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/base64.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/cbuf.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-adc.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-bt.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-cpu.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-dac.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-gpio.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-i2c.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-ledc.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-log.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-matrix.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-misc.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-psram.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-rmt.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-sigmadelta.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-spi.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-time.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-timer.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-touch.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/esp32-hal-uart.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/libb64/cdecode.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/libb64/cencode.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/main.cpp.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/stdlib_noniso.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/wiring_pulse.c.o
Compiling .pio/build/esp32doit-devkit-v1/FrameworkArduino/wiring_shift.c.o
Archiving .pio/build/esp32doit-devkit-v1/libFrameworkArduino.a
Indexing .pio/build/esp32doit-devkit-v1/libFrameworkArduino.a
Linking .pio/build/esp32doit-devkit-v1/firmware.elf
Building .pio/build/esp32doit-devkit-v1/firmware.bin
Retrieving maximum program size .pio/build/esp32doit-devkit-v1/firmware.elf
Checking size .pio/build/esp32doit-devkit-v1/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]  11.9% (used 39108 bytes from 327680 bytes)
Flash: [=======   ]  66.7% (used 874798 bytes from 1310720 bytes)
esptool.py v3.0
=================================================================== [SUCCESS] Took 24.54 seconds ===================================================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants