B4R Question Where is the error ?

jinyistudio

Well-Known Member
Licensed User
Longtime User
The following message appears after my program is executed. I don't understand where the error happened ?

B4X:
B4R Version: 2.51
Parsing code.    (0.00s)
Compiling code.    (0.01s)
Building project    (0.02s)
Compiling & deploying Ino project (Arduino/Genuino Mega or Mega 2560 - COM3)    Error
載入組態...
初始化套件...
正在準備開發板...
驗證中...
D:\jylab\project\b4r\Objects\bin\sketch\B4RCore.cpp.o (symbol from plugin): In function `B4R::PrintToMemory::write(unsigned char)':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
c:/program files/arduino/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions
D:\jylab\project\b4r\Objects\bin\sketch\B4RCore.cpp.o (symbol from plugin): In function `B4R::PrintToMemory::write(unsigned char)':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RCore.cpp.o (symbol from plugin): In function `B4R::PrintToMemory::write(unsigned char)':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RCore.cpp.o (symbol from plugin): In function `B4R::PrintToMemory::write(unsigned char)':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RCore.cpp.o (symbol from plugin): In function `B4R::PrintToMemory::write(unsigned char)':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RCore.cpp.o (symbol from plugin): In function `B4R::PrintToMemory::write(unsigned char)':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RCore.cpp.o (symbol from plugin): In function `B4R::PrintToMemory::write(unsigned char)':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char, SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RCore.cpp.o (symbol from plugin): In function `B4R::PrintToMemory::write(unsigned char)':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char, SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RCore.cpp.o (symbol from plugin): In function `B4R::PrintToMemory::write(unsigned char)':
(.text+0x0): multiple definition of `EasyCAT::SPIReadRegisterDirect(unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RCore.cpp.o (symbol from plugin): In function `B4R::PrintToMemory::write(unsigned char)':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteRegisterDirect(unsigned short, unsigned long)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RCore.cpp.o (symbol from plugin): In function `B4R::PrintToMemory::write(unsigned char)':
(.text+0x0): multiple definition of `EasyCAT::SPIReadRegisterIndirect(unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RCore.cpp.o (symbol from plugin): In function `B4R::PrintToMemory::write(unsigned char)':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteRegisterIndirect(unsigned long, unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RCore.cpp.o (symbol from plugin): In function `B4R::PrintToMemory::write(unsigned char)':
(.text+0x0): multiple definition of `EasyCAT::Init()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RCore.cpp.o (symbol from plugin): In function `B4R::PrintToMemory::write(unsigned char)':
(.text+0x0): multiple definition of `EasyCAT::SPIReadProcRamFifo()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RCore.cpp.o (symbol from plugin): In function `B4R::PrintToMemory::write(unsigned char)':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteProcRamFifo()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RCore.cpp.o (symbol from plugin): In function `B4R::PrintToMemory::write(unsigned char)':
(.text+0x0): multiple definition of `EasyCAT::MainTask()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RStream.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RStream.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RStream.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RStream.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RStream.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RStream.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RStream.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char, SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RStream.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char, SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RStream.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIReadRegisterDirect(unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RStream.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteRegisterDirect(unsigned short, unsigned long)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RStream.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIReadRegisterIndirect(unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RStream.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteRegisterIndirect(unsigned long, unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RStream.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::Init()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RStream.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIReadProcRamFifo()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RStream.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteProcRamFifo()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\B4RStream.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::MainTask()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\Scheduler.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\Scheduler.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\Scheduler.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\Scheduler.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\Scheduler.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\Scheduler.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\Scheduler.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char, SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\Scheduler.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char, SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\Scheduler.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIReadRegisterDirect(unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\Scheduler.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteRegisterDirect(unsigned short, unsigned long)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\Scheduler.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIReadRegisterIndirect(unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\Scheduler.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteRegisterIndirect(unsigned long, unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\Scheduler.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::Init()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\Scheduler.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIReadProcRamFifo()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\Scheduler.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteProcRamFifo()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\Scheduler.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::MainTask()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\b4r_main.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\b4r_main.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\b4r_main.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\b4r_main.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\b4r_main.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\b4r_main.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\b4r_main.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char, SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\b4r_main.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char, SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\b4r_main.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIReadRegisterDirect(unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\b4r_main.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteRegisterDirect(unsigned short, unsigned long)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\b4r_main.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIReadRegisterIndirect(unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\b4r_main.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteRegisterIndirect(unsigned long, unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\b4r_main.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::Init()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\b4r_main.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIReadProcRamFifo()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\b4r_main.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteProcRamFifo()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\b4r_main.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::MainTask()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\rEasyCAT.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\rEasyCAT.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\rEasyCAT.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\rEasyCAT.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\rEasyCAT.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\rEasyCAT.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\rEasyCAT.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char, SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\rEasyCAT.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char, SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\rEasyCAT.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIReadRegisterDirect(unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\rEasyCAT.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteRegisterDirect(unsigned short, unsigned long)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\rEasyCAT.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIReadRegisterIndirect(unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\rEasyCAT.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteRegisterIndirect(unsigned long, unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\rEasyCAT.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::Init()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\rEasyCAT.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIReadProcRamFifo()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\rEasyCAT.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteProcRamFifo()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\rEasyCAT.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::MainTask()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\src.ino.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\src.ino.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\src.ino.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\src.ino.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\src.ino.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\src.ino.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\src.ino.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char, SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\src.ino.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::EasyCAT(unsigned char, SyncMode)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\src.ino.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIReadRegisterDirect(unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\src.ino.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteRegisterDirect(unsigned short, unsigned long)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\src.ino.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIReadRegisterIndirect(unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\src.ino.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteRegisterIndirect(unsigned long, unsigned short, unsigned char)'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\src.ino.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::Init()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\src.ino.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIReadProcRamFifo()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\src.ino.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::SPIWriteProcRamFifo()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
D:\jylab\project\b4r\Objects\bin\sketch\src.ino.cpp.o (symbol from plugin): In function `EasyCAT::EasyCAT()':
(.text+0x0): multiple definition of `EasyCAT::MainTask()'
D:\jylab\project\b4r\Objects\bin\sketch\B4RArduino.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
 

jinyistudio

Well-Known Member
Licensed User
Longtime User
EasyCAT_Arduino.jpg

https://www.bausano.net/en/hardware/ethercat-e-arduino/easycat.html
 
Upvote 0

jinyistudio

Well-Known Member
Licensed User
Longtime User
attached file is my first wrapped library. I need help :(
 

Attachments

  • rEasyCAT.zip
    100.1 KB · Views: 326
Last edited:
Upvote 0

Siam

Active Member
Licensed User
Longtime User
#include "B4RDefines.h"
namespace B4R {
void B4REasyCAT::Initialize() {
hat = new (beEasyCAT) EasyCAT();
hat->Init();
}

void B4REasyCAT::Initialize1(unsigned char SPI_CHIP_SELECT) {
hat = new (beEasyCAT) EasyCAT(SPI_CHIP_SELECT);
hat->Init();
}

void B4REasyCAT::Initialize2(SyncMode Sync) {
hat = new (beEasyCAT) EasyCAT(Sync);
hat->Init();
}

void B4REasyCAT::Initialize3(unsigned char SPI_CHIP_SELECT, SyncMode Sync) {
hat = new (beEasyCAT) EasyCAT(SPI_CHIP_SELECT,Sync);
hat->Init();
}
}

the green one is the right place the red ones are wrong (redefines)
have a look to the other libs on github ... this helped me a lot
 
Upvote 0

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi
The original program(EasyCAT.h) has 4 constructor. So I build 4 Initialize function. Is this wrong?


B4X:
    EasyCAT();                              // default constructor
    EasyCAT(unsigned char SPI_CHIP_SELECT);
    EasyCAT(SyncMode Sync);            
    EasyCAT(unsigned char SPI_CHIP_SELECT, SyncMode Sync);
 
Last edited:
Upvote 0

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi
It seems that there is no problem with following.

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.
End Sub

Private Sub AppStart
    RunNative("Initialize", Null)
    Log("AppStart")
End Sub

#if C
    #include <EasyCAT.h>
    EasyCAT hat;

    void Initialize (B4R::Object* o) {
        hat.Init();
    }
#End if
 
Upvote 0

Siam

Active Member
Licensed User
Longtime User
hi,

so far i see you need only one constructor

EasyCAT(unsigned char SPI_CHIP_SELECT);
EasyCAT(SyncMode Sync);
EasyCAT(unsigned char SPI_CHIP_SELECT, SyncMode Sync);

the first line inits easycat only with the cs

the next line inits easycat only with the sync mode

and the last line inits easycat with sync mode and cs

so you have to check in the init routine if SPI_CHIP_SELECT or / and SyncMode Sync is set
and then you can call the right constructor.
 
Upvote 0

jinyistudio

Well-Known Member
Licensed User
Longtime User
Hi

I try to remove any function as following. I found that the same problem occurs when I include "EasyCAT.h". :(

rEasyCAT.h
B4X:
#pragma once
#include "B4RDefines.h"
#include "EasyCAT.h"
//~version: 1.1
namespace B4R {
    //~shortname: EasyCAT
    class B4REasyCAT {
        private:   
              
        public:
            void Initialize();           
            void CycleTask();
    };   
}

rEasyCAT.cpp
B4X:
#include "B4RDefines.h"
namespace B4R {   
    void B4REasyCAT::Initialize() {
      

    }   
}
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Please change the tread title to something more meaninfull
 
Upvote 0

Siam

Active Member
Licensed User
Longtime User
ok now i understand the problem

This part in The library is the problem:

B4X:
//--------------------------------------------------------------------------------
// This is the code that usually is in the .cpp file.
// This seems to be the only way to allow the library
// configuration through "#defines" in the ino. file 
//-------------------------------------------------------------------------------- 
 
    
//---- constructors --------------------------------------------------------------------------------

EasyCAT::EasyCAT()                              //------- default constructor ----------------------
{                                               //
  Sync_ = ASYNC;                                // if no synchronization mode is declared
                                                // ASYNC is the default
                                                //
  SCS = 9;                                      // if no chip select is declared
  digitalWrite (SCS, HIGH);                     // pin 9 is the default
}                                               //


EasyCAT::EasyCAT(unsigned char SPI_CHIP_SELECT) //------- SPI_CHIP_SELECT options -----------------
                                                //
                                                // we can choose between:
                                                // 8, 9, 10, A5, 6, 7
{                                               //                                       
  SCS = SPI_CHIP_SELECT;                        //  initialize chip select 
  digitalWrite (SCS, HIGH);                     //     
}
 

EasyCAT::EasyCAT(SyncMode Sync)                 //-------Synchronization options ----------------------

for now i have no solution to fix this issue maybee someone with more C knowledge can help you
 
Upvote 0
Top