Hi,
I’m trying to figure out why compiling of the project fails under Windows (Win7 and Win10 - latter was completely fresh install of VS Code + PlatformIO) where as the same project compiles fine under Linux.
Platform: Arduino MEGA 2560 pro
Additional libraries: HeliOS, Adafruit GFX, ModbusRTUMaster, Arduino_ST7789_FastMaster (not via libdeb but just added to lib folder beause this is not available via PlatformIO). Some basic libraries from Arduino such as SPI.
Problems started when I had to change from FreeRTOS to HeliOS (FreeRTOS caused severe issues in SPI communication with display due task switchin - disabling interrupts “solved” the problem but this is not a solution I can use). There was initially a problem with HeliOS.h file which have a small piece of code at the end. For some reason this got included many times despite the #ifdef guard. Moved this to own cpp-file and problem gone (wasn’t able to link it before this change).
Under Linux there’s no more errors and project compiles and links and also works in the target fine.
When I try to compile the same code under windows it produces 68 errors. All related to HeliOS files. Errors like:
previous definition of 'struct TaskNotification_s'
previous definition of 'struct TaskRunTimeStats_s'
previous definition of 'struct MemoryRegionStats_s'
previous definition of 'struct TaskInfo_s'
previous definition of 'struct QueueMessage_s'
previous definition of 'struct SystemInfo_s'
Actually 7 header files are producing errors and I find this pretty much impossible for a released library. So, something is wrong with the building but just cannot figure out what.
HeliOS is c-code, Arduino libs are c++ code and my code is c inside cpp-files. This has not been an issues previously in many other projects. I usually develop under Linux and then move to laptop to download to the target (target after testing is physically far away from Linux machine).
I have removed .vscode (rebuilt this after deletion) and framework-arduino-avr but no difference.
platformio.ini:
[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
monitor_speed = 115200
lib_deps =
heliosproj/HeliOS@^0.4.1
adafruit/Adafruit GFX Library@^1.11.3
cmb27/ModbusRTUMaster@^1.0.5
lib_ldf_mode = chain
lib_compat_mode = soft
Any idea what could be the reason for this problem?