SPI and SD .begin methods - no parameters?

I’m trying to implement the SPI and SD functions to connect an SD card to my ESP32:

 #include <SPI.h>
  #include <SD.h>

// SD Card pin definitions
#define SD_MISO 19;
#define SD_MOSI 23;
#define SD_CLK 18;
#define SD_CS 5;

In the setup() method of my main.cpp:

  // set up SD card
  SPI.begin(SD_CLK,SD_MISO,SD_MOSI,SD_CS);
  if (!SD.begin()) {Serial.println("SD CARD mount fail. :( ");}
  else {Serial.println("SD CARD mount success! :) ");}

However, I noticed that SD.begin and SPI.begin both only take without parameters. I.e. adding the SD_CLK, etc. values results in a compile error, but without parameters (i.e. SD.begin() and SPI.begin() ), it can compile and run. The problem with that is that I get an SD card mount fail. Full error is:

[   325][E][sd_diskio.cpp:199] sdCommand(): Card Failed! cmd: 0x00
[   332][E][sd_diskio.cpp:806] sdcard_mount(): f_mount failed: (3) The physical drive cannot work
[   641][E][sd_diskio.cpp:199] sdCommand(): Card Failed! cmd: 0x00

I’m wondering if this is because the begin() methods can’t be overloaded with parameters? Why is this?

Both classes have begin functions with parameters. But all parameters are provided with default values. This means, when the function is called without parameters, the default values are used.

Please show the full errror message.

Please show the full errror message.

I just get a red underline:

expected a ')'

This implied to me that for some reason the compiler will only take it if it’s passed w/o parameters.

The error is here! Remove the semicolons at the end of each line!

When defining macros you must not have semicolons at the end.
You can clearly see this in the screenshot:
#define SD_CSLK 18; expands to 18;

That means the line
SPI.begin(SD_CLK,SD_MISO,SD_MOSI,SD_CS); expands to
SPI.begin(18;,19;,23;,5;); which is invalid.

Correct declaration of macros:

#define SD_MISO 19
#define SD_MOSI 23
#define SD_CLK 18
#define SD_CS 5

Alternatively you can use constants:

const int SD_MISO = 19;
const int SD_MOSI = 23;
const int SD_CLK = 18;
const int SD_CS = 5;