Я работаю над небольшим проектом, в котором использую ESP32, чтобы каждое утро отправлять мне электронное письмо с прогнозом погоды.
Я уже позаботился о электронной почте и Wi-Fi, но не могу решить проблему, возникающую при вызове API, который я использую для получения прогноза погоды.
Я использую оболочку для API meteosource: https://github.com/Meteosource/meteosource_cpp
Моя проблема связана с моими библиотеками, это был беспорядок из-за того, что PlatformIO не у меня были базовые библиотеки, поэтому я добавил их в папку lib (я использовал cp для копирования всех библиотек из /usr/include/linux_x86.. в мою библиотеку в моем проекте). Для моей библиотеки погоды я добавил ее вот так

Затем я вызываю API, как показано в примере репозитория:
Код: Выделить всё
const std::string api_key = "MY_API_KEY";
const std::string tier = "free";
Meteosource m = Meteosource(api_key, tier);
Но когда я пытаюсь для сборки, я получаю эту неприятную ошибку:
Код: Выделить всё
Building in release mode
Compiling .pio\build\nodemcu-32s\src\main.cpp.o
Linking .pio\build\nodemcu-32s\firmware.elf
c:/users/thomm/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\nodemcu-32s\lib266\libWeather_Bib.a(RequestHandler.cpp.o):(.literal._ZN14RequestHandlerC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x0): undefined reference to `curl_easy_init'
c:/users/thomm/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\nodemcu-32s\lib266\libWeather_Bib.a(RequestHandler.cpp.o):(.literal._ZN14RequestHandlerC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x4): undefined reference to `curl_easy_setopt'
c:/users/thomm/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\nodemcu-32s\lib266\libWeather_Bib.a(RequestHandler.cpp.o):(.literal._ZN14RequestHandlerD2Ev+0x0): undefined reference to `curl_easy_cleanup'
c:/users/thomm/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\nodemcu-32s\lib266\libWeather_Bib.a(RequestHandler.cpp.o): in function `RequestHandler::RequestHandler(std::__cxx11::basic_string)':
C:\Users\thomm\Documents\PlatformIO\Projects\ESP32_HelloWorld/lib/Weather_Bib/src/RequestHandler.cpp:32: undefined reference to `curl_easy_init'
c:/users/thomm/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\thomm\Documents\PlatformIO\Projects\ESP32_HelloWorld/lib/Weather_Bib/src/RequestHandler.cpp:33: undefined reference to `curl_easy_setopt'
c:/users/thomm/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\thomm\Documents\PlatformIO\Projects\ESP32_HelloWorld/lib/Weather_Bib/src/RequestHandler.cpp:34: undefined reference to `curl_easy_setopt'
c:/users/thomm/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\thomm\Documents\PlatformIO\Projects\ESP32_HelloWorld/lib/Weather_Bib/src/RequestHandler.cpp:35: undefined reference to `curl_easy_setopt'
c:/users/thomm/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\nodemcu-32s\lib266\libWeather_Bib.a(RequestHandler.cpp.o): in function `RequestHandler::~RequestHandler()':
C:\Users\thomm\Documents\PlatformIO\Projects\ESP32_HelloWorld/lib/Weather_Bib/src/RequestHandler.cpp:41: undefined reference to `curl_easy_cleanup'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\nodemcu-32s\firmware.elf] Error 1
Код: Выделить всё
#include "Lin_bibs/curl/curl.h"

Вот изображение завитка дерева:

Надеюсь, вы поможете мне решить эту проблему.
Подробнее здесь: https://stackoverflow.com/questions/791 ... platformio