Open yigitbacakoglu opened 4 years ago
@stephen1874 can you please have a look at this issue? your help will be appreciated. Thanks
Hello @yigitbacakoglu , the error is multiple definition, could you pelase check if you have 2 same library in your folder or somethere else. I just with Arduino 1.8.10, everything is ok.
Hello @yigitbacakoglu , the error is multiple definition, could you pelase check if you have 2 same library in your folder or somethere else. I just with Arduino 1.8.10, everything is ok.
Hi Stephen, thanks for quick reply,
Yeap I found this library in the same folder of the .ino file and in the Arduino/libraries folder. and removing one resolved the multiple definition of
error but not ISO C++ forbids converting a string constant to
error.
So I changed all cmdOk usages from
unsigned char Serial_CAN::exitSettingMode() { clear(); int ret = cmdOk("AT+Q\r\n"); clear(); return ret; }
to
unsigned char Serial_CAN::exitSettingMode() { clear(); int ret = cmdOk((char *)"AT+Q\r\n"); clear(); return ret; }
and it was compiled, does it make any sense?
@yigitbacakoglu yes, this make sense, I will modify the code to avoid this wraning as well. Thanks.
Hi, could you please help me with the error below;
` Arduino: 1.8.12 (Mac OS X), Board: "Arduino Nano, ATmega328P"
sketch/Serial_CAN_Module.cpp: In member function 'unsigned char Serial_CAN::exitSettingMode()': sketch/Serial_CAN_Module.cpp:172:31: warning: ISO C++ forbids converting a string constant to 'char' [-Wwrite-strings] int ret = cmdOk("AT+Q\r\n"); ^ sketch/Serial_CAN_Module.cpp: In member function 'unsigned char Serial_CAN::factorySetting()': sketch/Serial_CAN_Module.cpp:286:26: warning: ISO C++ forbids converting a string constant to 'char' [-Wwrite-strings] if(cmdOk("AT\r\n")) ^ /Users/yigit/Documents/Arduino/libraries/Serial_CAN_Module/Serial_CAN_Module.cpp: In member function 'unsigned char Serial_CAN::exitSettingMode()': /Users/yigit/Documents/Arduino/libraries/Serial_CAN_Module/Serial_CAN_Module.cpp:172:31: warning: ISO C++ forbids converting a string constant to 'char' [-Wwrite-strings] int ret = cmdOk("AT+Q\r\n"); ^ /Users/yigit/Documents/Arduino/libraries/Serial_CAN_Module/Serial_CAN_Module.cpp: In member function 'unsigned char Serial_CAN::factorySetting()': /Users/yigit/Documents/Arduino/libraries/Serial_CAN_Module/Serial_CAN_Module.cpp:286:26: warning: ISO C++ forbids converting a string constant to 'char' [-Wwrite-strings] if(cmdOk("AT\r\n")) ^ libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In function
canSerial': (.text+0x0): multiple definition of
canSerial' sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In functioncanSerial': (.text+0x0): multiple definition of
Serial_CAN::begin(int, int, unsigned long)' sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In functioncanSerial': (.text+0x0): multiple definition of
Serial_CAN::send(unsigned long, unsigned char, unsigned char, unsigned char, unsigned char const)' sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In functioncanSerial': (.text+0x0): multiple definition of
Serial_CAN::recv(unsigned long, unsigned char)' sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In functioncanSerial': (.text+0x0): multiple definition of
Serial_CAN::clear()' sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In functioncanSerial': (.text+0x0): multiple definition of
Serial_CAN::cmdOk(char)' sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In functioncanSerial': (.text+0x0): multiple definition of
Serial_CAN::enterSettingMode()' sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In functioncanSerial': (.text+0x0): multiple definition of
Serial_CAN::exitSettingMode()' sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In functioncanSerial': (.text+0x0): multiple definition of
Serial_CAN::canRate(unsigned char)' sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In functioncanSerial': (.text+0x0): multiple definition of
Serial_CAN::baudRate(unsigned char)' sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In functioncanSerial': (.text+0x0): multiple definition of
make8zerochar(int, char, unsigned long)' sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In functioncanSerial': (.text+0x0): multiple definition of
Serial_CAN::setMask(unsigned long)' sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In functioncanSerial': (.text+0x0): multiple definition of
Serial_CAN::setFilt(unsigned long*)' sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In functioncanSerial': (.text+0x0): multiple definition of
Serial_CAN::factorySetting()' sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here libraries/Serial_CAN_Module/Serial_CAN_Module.cpp.o (symbol from plugin): In functioncanSerial': (.text+0x0): multiple definition of
Serial_CAN::debugMode()' sketch/Serial_CAN_Module.cpp.o (symbol from plugin):(.text+0x0): first defined here collect2: error: ld returned 1 exit status exit status 1 Error compiling for board Arduino Nano.This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences. `