Esp32cam giving errors on platformio

Hello, I am trying to set up my esp32cam on platformio but I keep getting this error:

My code is as follows:

#include <Arduino.h>
#include <esp32cam.h>
#include <WebServer.h>
#include <WiFi.h>

#define AP_SSID "mordred"
#define AP_PASS "mordred"

WebServer server(80);

void handleCapture() {
  auto img = esp32cam::capture();
  if (img == nullptr) {
    server.send(500, "", "");
    return;
  }
  server.setContentLength(img->size());
  server.send(200, "image/jpeg");
  WiFiClient client = server.client();
  img->writeTo(client);
}

void handleStream() {
  esp32cam::Camera.streamMjpeg(server.client());
}

void setup() {
  // auto res = esp32cam::Resolution::find(1024, 768);
  auto res = esp32cam::Resolution::find(160, 120);
  esp32cam::Config cfg;
  cfg.setPins(esp32cam::pins::AiThinker);
  cfg.setResolution(res);
  cfg.setJpeg(80);
  esp32cam::Camera.begin(cfg);
  WiFi.softAP(AP_SSID, AP_PASS);
  server.on("/capture.jpg", handleCapture);
  server.on("/stream.jpg", handleStream);
  server.begin();
}

void loop() {
  server.handleClient()

And this is what my platform.ini looks like:

[env:esp-wrover-kit]
platform = espressif32
board = esp-wrover-kit
framework = arduino
lib_deps = yoursunny/esp32cam@^0.0.20250112

It works fine on the arduino ide, but I wanted to port it over to platformio since that’s what i’m more familiar with. Thanks for the help!

This library requires Espressif Arduino Core version 3.x.

To get the latest Espresif Arduino version 3.2 you have to use the pioarduino-fork of the espressif32-platform. Simply change your platformio.ini to:

[env:esp-wrover-kit]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.20/platform-espressif32.zip
board = esp-wrover-kit
framework = arduino
lib_deps = yoursunny/esp32cam@^0.0.20250112

Hello, thanks for the response. The code uploads now but when i go to the stream.jpg endpoint no video shows up.

was wondering why this is the case? it shouldn’t be anything code wise since the video streams fine on the arduino ide

should be

board = esp32cam

to match cfg.setPins(esp32cam::pins::AiThinker);

That worked perfectly, thank you so much!