Closed aaron-neal closed 2 years ago
It looks like using inline on functions clears them from the multiple definitions list. e.g.:
inline int DNSClient::inet_aton(const char* address, IPAddress& result)
Did you try and follow the instructions in multiFileProject example to avoid Multiple Definitions
This library was used in many more complex projects / libraries without error by not carelessly and blindly including any h
file.
Please spend some time to research which libraries is using and how to have some ideas, if necessary.
I'm sure won't go back to the old cpp
style.
Good Luck,
Thank you @khoih-prog, I had not seen that example. Got me on my way. Cheers.
Describe the bug
I am have included Ethernet_Generic.h in my main file for starting a webserver. I also have Ethernet_Generic included in another header file for a Modbus TCP class.
On compiling I get many multiple definition errors such as
c:/users/??????/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: .pio/build/stm32-5mi/src/modbus/ModbusTCPSlave.cpp.o:(.bss._ZN10W5100Class4chipE+0x0): multiple definition of `W5100Class::chip'; .pio/build/stm32-5mi/src/main.cpp.o:(.bss._ZN10W5100Class4chipE+0x0): first defined here
Any help would be appreciated.
Expected behavior
When using previous Ethernet library, everything compiled as normal. Previous Library
Information
STM32
core