Hi, I am working on a project that runs on an esp32 dev-kit C. My code compiles in Arduino IDE but when I ported it into platformIO on VSCode, it does not compile. Initially, this was because I needed to add #include files to each .cpp file and bring all the function declarations or variables to the top of the file or to a separate header file. After going through this long process, there were no more errors in my files but the .elf file failed as did the build. I do not know why and have been struggling with this for a while, here’s my terminal output:
c:/users/matth/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio/build/esp32doit-devkit-v1/src/main.cpp.o:C:\Users\matth\Documents\PlatformIO\Projects\MVP_Code/src/00_main.h:48: multiple definition of `access_point_mode'; .pio/build/esp32doit-devkit-v1/src/01_Async_Server.cpp.o:C:\Users\matth\Documents\PlatformIO\Projects\MVP_Code/src/00_main.h:48: first defined here
c:/users/matth/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio/build/esp32doit-devkit-v1/src/main.cpp.o:C:\Users\matth\Documents\PlatformIO\Projects\MVP_Code/src/00_main.h:46: multiple definition of `user_PW'; .pio/build/esp32doit-devkit-v1/src/01_Async_Server.cpp.o:C:\Users\matth\Documents\PlatformIO\Projects\MVP_Code/src/00_main.h:46: first defined here
c:/users/matth/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio/build/esp32doit-devkit-v1/src/main.cpp.o:C:\Users\matth\Documents\PlatformIO\Projects\MVP_Code/src/00_main.h:45: multiple definition of `user_SSID'; .pio/build/esp32doit-devkit-v1/src/01_Async_Server.cpp.o:C:\Users\matth\Documents\PlatformIO\Projects\MVP_Code/src/00_main.h:45: first defined here
c:/users/matth/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio/build/esp32doit-devkit-v1/src/Drying_RTOS.cpp.o:(.literal._Z30Drying_Condenser_Sequence_RTOSv+0x0): undefined reference to `Drying_Condenser_Sequence_RTOS_is_ON'
c:/users/matth/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio/build/esp32doit-devkit-v1/src/Mixing_Motor.cpp.o:(.literal._Z19Timed_Transfer_TaskPv+0x10): undefined reference to `Timed_Transfer_is_ON'
**collect2.exe: error: ld returned 1 exit status**
***** [.pio\build\esp32doit-devkit-v1\firmware.elf] Error 1**```
(The terminal output is a lot longer but I could not fit it within the character limit and it was pretty similar to the warnings noted above)
In summary, all these outputs are warnings, not errors. It is only the last 2 lines of the terminal that are causing me problems and I don't know why? Can someone please help? Also unfortunately, I don't have permission to share the code.