Hello everyone,
I successfully compiled a project in Arduino IDE, and now I want to migrate it to PlatformIO for development. However, I encountered the following issue:
Linking .pio\build\due\firmware.elf
.pio\build\due\src\main.cpp.o: In function `mapEmptyBuffers()':
main.cpp:(.text._Z15mapEmptyBuffersv+0x78): undefined reference to `bool_output'
main.cpp:(.text._Z15mapEmptyBuffersv+0x80): undefined reference to `int_output'
main.cpp:(.text._Z15mapEmptyBuffersv+0x84): undefined reference to `bool_input'
main.cpp:(.text._Z15mapEmptyBuffersv+0x88): undefined reference to `int_input'
.pio\build\due\src\main.cpp.o: In function `modbusTask()':
main.cpp:(.text._Z10modbusTaskv+0xb8): undefined reference to `bool_output'
main.cpp:(.text._Z10modbusTaskv+0xbc): undefined reference to `int_output'
main.cpp:(.text._Z10modbusTaskv+0xc4): undefined reference to `int_input'
main.cpp:(.text._Z10modbusTaskv+0xc8): undefined reference to `bool_input'
.pio\build\due\src\main.cpp.o: In function `plcCycleTask()':
main.cpp:(.text._Z12plcCycleTaskv+0x2): undefined reference to `updateInputBuffers'
main.cpp:(.text._Z12plcCycleTaskv+0xe): undefined reference to `config_run__'
main.cpp:(.text._Z12plcCycleTaskv+0x12): undefined reference to `updateOutputBuffers'
main.cpp:(.text._Z12plcCycleTaskv+0x1a): undefined reference to `updateTime'
.pio\build\due\src\main.cpp.o: In function `setup':
main.cpp:(.text.setup+0xe): undefined reference to `config_init__'
main.cpp:(.text.setup+0x12): undefined reference to `glueVars'
main.cpp:(.text.setup+0x16): undefined reference to `hardwareInit'
main.cpp:(.text.setup+0x54): undefined reference to `common_ticktime__'
.pio\build\due\lib1a8\libModbusSlave.a(ModbusSlave.cpp.o): In function `debugInfo()':
ModbusSlave.cpp:(.text._Z9debugInfov+0x2): undefined reference to `get_var_count'
.pio\build\due\lib1a8\libModbusSlave.a(ModbusSlave.cpp.o): In function `debugSetTrace(unsigned short, unsigned char, unsigned short, void*)':
ModbusSlave.cpp:(.text._Z13debugSetTracethtPv+0xc): undefined reference to `get_var_count'
ModbusSlave.cpp:(.text._Z13debugSetTracethtPv+0x38): undefined reference to `set_trace'
.pio\build\due\lib1a8\libModbusSlave.a(ModbusSlave.cpp.o): In function `debugGetTrace(unsigned short, unsigned short)':
ModbusSlave.cpp:(.text._Z13debugGetTracett+0x8): undefined reference to `get_var_count'
ModbusSlave.cpp:(.text._Z13debugGetTracett+0x24): undefined reference to `get_var_size'
ModbusSlave.cpp:(.text._Z13debugGetTracett+0x3c): undefined reference to `get_var_addr'
.pio\build\due\lib1a8\libModbusSlave.a(ModbusSlave.cpp.o): In function `debugGetTraceList(unsigned short, unsigned char*)':
ModbusSlave.cpp:(.text._Z17debugGetTraceListtPh+0x8): undefined reference to `get_var_count'
ModbusSlave.cpp:(.text._Z17debugGetTraceListtPh+0x8e): undefined reference to `get_var_size'
ModbusSlave.cpp:(.text._Z17debugGetTraceListtPh+0xa0): undefined reference to `get_var_addr'
.pio\build\due\lib1a8\libModbusSlave.a(ModbusSlave.cpp.o): In function `debugGetMd5(void*)':
ModbusSlave.cpp:(.text._Z11debugGetMd5Pv+0x10): undefined reference to `set_endianness'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\due\firmware.elf] Error 1
I have followed the README instructions to create subfolders in the lib
folder and moved all files except main.cpp
into these subfolders. Here is my project.
If anyone has time, please help me solve this problem. I sincerely appreciate it!