BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Blynk on PlatforIO

Hi,

I am trying to use the provision example from Blynk that runs on Arduino IDE to be able to compile with PlatformIO, I am getting some multi-defenition errors when invoking linker on the Blynk library.

Anyone faced those issues?

Thanks
Sharon
| | |-- 1.0 (C:\Users\Sharon.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266WiFi)
| |-- 1.0 (C:\Users\Sharon.platformio\packages\framework-arduinoespressif8266\libraries\ESP8266WiFi)
Building in release mode
xtensa-lx106-elf-g++ -o .pio\build\d1\firmware.elf -T eagle.flash.4m1m.ld -Os -nostdlib -Wl,–no-check-sections -Wl,-static -Wl,–gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read -u app_entry -u _printf_float -u _scanf_float -u _DebugExceptionVector -u _DoubleExceptionVector -u _KernelExceptionVector -u _NMIExceptionVector -u _UserExceptionVector .pio\build\d1\src\Sys_Config.cpp.o .pio\build\d1\src\main.cpp.o -L.pio\build\d1 -L.pio\build\d1\ld -LC:\Users\Sharon.platformio\packages\framework-arduinoespressif8266\tools\sdk\lib -LC:\Users\Sharon.platformio\packages\framework-arduinoespressif8266\tools\sdk\ld -LC:\Users\Sharon.platformio\packages\framework-arduinoespressif8266\tools\sdk\libc\xtensa-lx106-elf\lib -LC:\Users\Sharon.platformio\packages\framework-arduinoespressif8266\tools\sdk\lib\NONOSDK22x_190703 -Wl,–start-group .pio\build\d1\lib4cc\libESP8266WiFi.a .pio\build\d1\lib74b\libBlynk_ID415.a .pio\build\d1\lib099\libDNSServer.a .pio\build\d1\lib46c\libESP8266WebServer.a .pio\build\d1\libea7\libESP8266HTTPUpdateServer.a .pio\build\d1\libfa4\libEEPROM.a .pio\build\d1\libc41\libTicker.a .pio\build\d1\lib99b\libESP8266HTTPClient.a .pio\build\d1\libae9\libESP8266httpUpdate.a .pio\build\d1\libFrameworkArduinoVariant.a .pio\build\d1\libFrameworkArduino.a -lhal -lphy -lpp -lnet80211 -lwpa -lcrypto -lmain -lwps -lbearssl -laxtls -lespnow -lsmartconfig -lairkiss -lwpa2 -lstdc++ -lm -lc -lgcc -llwip2-536-feat -Wl,–end-group
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o:(.bss._ZN10BlynkState5stateE+0x0): multiple definition of BlynkState::state'; .pio\build\d1\src\Sys_Config.cpp.o:(.bss._ZN10BlynkState5stateE+0x0): first defined here c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function BlynkState::get()’:
main.cpp:(.text._ZN10BlynkState3getEv+0x4): multiple definition of BlynkState::get()'; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._ZN10BlynkState3getEv+0x4): first defined here c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function BlynkState::is(State)’:
main.cpp:(.text._ZN10BlynkState2isE5State+0x4): multiple definition of BlynkState::is(State)'; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._ZN10BlynkState2isE5State+0x4): first defined here c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o:(.bss.configStore+0x0): multiple definition of configStore’; .pio\build\d1\src\Sys_Config.cpp.o:(.bss.configStore+0x0): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function config_load()': main.cpp:(.text._Z11config_loadv+0x1c): multiple definition of config_load()’; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._Z11config_loadv+0x1c): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function config_save()': main.cpp:(.text._Z11config_savev+0x14): multiple definition of config_save()’; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._Z11config_savev+0x14): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function config_init()': main.cpp:(.text._Z11config_initv+0xc): multiple definition of config_init()’; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._Z11config_initv+0xc): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function button_change()': main.cpp:(.text._Z13button_changev+0x1c): multiple definition of button_change()’; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._Z13button_changev+0x1c): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function button_init()': main.cpp:(.text._Z11button_initv+0xc): multiple definition of button_init()’; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._Z11button_initv+0xc): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function restartMCU()': main.cpp:(.text._Z10restartMCUv+0x8): multiple definition of restartMCU()’; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._Z10restartMCUv+0x8): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o:(.bss.g_buttonPressed+0x0): multiple definition of g_buttonPressed'; .pio\build\d1\src\Sys_Config.cpp.o:(.bss.g_buttonPressed+0x0): first defined here c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o:(.data.g_buttonPressTime+0x0): multiple definition of g_buttonPressTime’; .pio\build\d1\src\Sys_Config.cpp.o:(.data.g_buttonPressTime+0x0): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function button_action()': main.cpp:(.text._Z13button_actionv+0x4): multiple definition of button_action()’; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._Z13button_actionv+0x4): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function enterConnectNet()': main.cpp:(.text._Z15enterConnectNetv+0x3c): multiple definition of enterConnectNet()’; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._Z15enterConnectNetv+0x3c): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function enterSwitchToSTA()': main.cpp:(.text._Z16enterSwitchToSTAv+0x18): multiple definition of enterSwitchToSTA()’; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._Z16enterSwitchToSTAv+0x18): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function enterError()': main.cpp:(.text._Z10enterErrorv+0x24): multiple definition of enterError()’; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._Z10enterErrorv+0x24): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o:(.bss.overTheAirURL+0x0): multiple definition of overTheAirURL'; .pio\build\d1\src\Sys_Config.cpp.o:(.bss.overTheAirURL+0x0): first defined here c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function enterOTA()’:
main.cpp:(.text._Z8enterOTAv+0x28): multiple definition of enterOTA()'; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._Z8enterOTAv+0x28): first defined here c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function enterResetConfig()’:
main.cpp:(.text._Z16enterResetConfigv+0x14): multiple definition of enterResetConfig()'; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._Z16enterResetConfigv+0x14): first defined here c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o:(.bss.Blynk+0x0): multiple definition of Blynk’; .pio\build\d1\src\Sys_Config.cpp.o:(.bss.Blynk+0x0): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function BlynkWidgetWriteInternalPinOTA': main.cpp:(.text.BlynkWidgetWriteInternalPinOTA+0x18): multiple definition of BlynkWidgetWriteInternalPinOTA’; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text.BlynkWidgetWriteInternalPinOTA+0x18): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function indicator_run()': main.cpp:(.text._Z13indicator_runv+0x2c): multiple definition of indicator_run()’; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._Z13indicator_runv+0x2c): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o:(.bss.blinker+0x0): multiple definition of blinker'; .pio\build\d1\src\Sys_Config.cpp.o:(.bss.blinker+0x0): first defined here c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function indicator_init()’:
main.cpp:(.text._Z14indicator_initv+0x24): multiple definition of indicator_init()'; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._Z14indicator_initv+0x24): first defined here c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o:(.bss.indicator+0x0): multiple definition of indicator’; .pio\build\d1\src\Sys_Config.cpp.o:(.bss.indicator+0x0): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function enterConnectCloud()': main.cpp:(.text._Z17enterConnectCloudv+0x50): multiple definition of enterConnectCloud()’; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._Z17enterConnectCloudv+0x50): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o:(.bss.server+0x0): multiple definition of server'; .pio\build\d1\src\Sys_Config.cpp.o:(.bss.server+0x0): first defined here c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o:(.data.config_form+0x0): multiple definition of config_form’; .pio\build\d1\src\Sys_Config.cpp.o:(.data.config_form+0x0): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o:(.bss.dnsServer+0x0): multiple definition of dnsServer'; .pio\build\d1\src\Sys_Config.cpp.o:(.bss.dnsServer+0x0): first defined here c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o:(.bss.httpUpdater+0x0): multiple definition of httpUpdater’; .pio\build\d1\src\Sys_Config.cpp.o:(.bss.httpUpdater+0x0): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o: in function enterConfigMode()': main.cpp:(.text._Z15enterConfigModev+0x134): multiple definition of enterConfigMode()’; .pio\build\d1\src\Sys_Config.cpp.o:Sys_Config.cpp:(.text._Z15enterConfigModev+0x134): first defined here
c:/users/sharon/.platformio/packages/toolchain-xtensa/bin/…/lib/gcc/xtensa-lx106-elf/4.8.2/…/…/…/…/xtensa-lx106-elf/bin/ld.exe: .pio\build\d1\src\main.cpp.o:(.bss.BlynkProvisioning+0x0): multiple definition of `BlynkProvisioning’; .pio\build\d1\src\Sys_Config.cpp.o:(.bss.BlynkProvisioning+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\d1\firmware.elf] Error 1

I was able to solve it, appears as PlatformIO dont use #pragma once