I looked at the ZIP you posted and the compilation yields all undefined reference to the entire coapServer
class.
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01\src\CoapServerEsp8266.cpp.o:(.text._Z14callback_lightP10coapPacket9IPAddressii+0x20): undefined reference to `coapServer::sendResponse(char*)'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01\src\CoapServerEsp8266.cpp.o:(.text._Z14callback_lightP10coapPacket9IPAddressii+0x24): undefined reference to `coapServer::sendResponse(IPAddress, int, char*)'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01\src\CoapServerEsp8266.cpp.o: in function `callback_light(coapPacket*, IPAddress, int, int)':
CoapServerEsp8266.cpp:(.text._Z14callback_lightP10coapPacket9IPAddressii+0xcb): undefined reference to `coapServer::sendResponse(char*)'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: CoapServerEsp8266.cpp:(.text._Z14callback_lightP10coapPacket9IPAddressii+0xe7): undefined reference to `coapServer::sendResponse(IPAddress, int, char*)'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01\src\CoapServerEsp8266.cpp.o: in function `callback_rpm(coapPacket*, IPAddress, int, int)':
CoapServerEsp8266.cpp:(.text._Z12callback_rpmP10coapPacket9IPAddressii+0xbe): undefined reference to `coapServer::sendResponse(char*)'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: CoapServerEsp8266.cpp:(.text._Z12callback_rpmP10coapPacket9IPAddressii+0xd9): undefined reference to `coapServer::sendResponse(IPAddress, int, char*)'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01\src\CoapServerEsp8266.cpp.o: in function `callback_temp(coapPacket*, IPAddress, int, int)':
CoapServerEsp8266.cpp:(.text._Z13callback_tempP10coapPacket9IPAddressii+0xbe): undefined reference to `coapServer::sendResponse(char*)'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: CoapServerEsp8266.cpp:(.text._Z13callback_tempP10coapPacket9IPAddressii+0xd9): undefined reference to `coapServer::sendResponse(IPAddress, int, char*)'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01\src\CoapServerEsp8266.cpp.o: in function `callback_speed(coapPacket*, IPAddress, int, int)':
CoapServerEsp8266.cpp:(.text._Z14callback_speedP10coapPacket9IPAddressii+0xc2): undefined reference to `coapServer::sendResponse(char*)'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: CoapServerEsp8266.cpp:(.text._Z14callback_speedP10coapPacket9IPAddressii+0xdd): undefined reference to `coapServer::sendResponse(IPAddress, int, char*)'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01\src\CoapServerEsp8266.cpp.o:(.text.setup+0x48): undefined reference to `coapServer::server(void (*)(coapPacket*, IPAddress, int, int), String)'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01\src\CoapServerEsp8266.cpp.o:(.text.setup+0x4c): undefined reference to `coapServer::start()'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01\src\CoapServerEsp8266.cpp.o: in function `setup':
CoapServerEsp8266.cpp:(.text.setup+0x124): undefined reference to `coapServer::server(void (*)(coapPacket*, IPAddress, int, int), String)'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: CoapServerEsp8266.cpp:(.text.setup+0x13e): undefined reference to `coapServer::server(void (*)(coapPacket*, IPAddress, int, int), String)'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: CoapServerEsp8266.cpp:(.text.setup+0x158): undefined reference to `coapServer::server(void (*)(coapPacket*, IPAddress, int, int), String)'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: CoapServerEsp8266.cpp:(.text.setup+0x172): undefined reference to `coapServer::server(void (*)(coapPacket*, IPAddress, int, int), String)'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: CoapServerEsp8266.cpp:(.text.setup+0x17f): undefined reference to `coapServer::start()'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01\src\CoapServerEsp8266.cpp.o:(.text.loop+0x4): undefined reference to `coapServer::loop()'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01\src\CoapServerEsp8266.cpp.o: in function `loop':
CoapServerEsp8266.cpp:(.text.loop+0x11): undefined reference to `coapServer::loop()'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01\src\CoapServerEsp8266.cpp.o:(.text.startup._GLOBAL__sub_I_coap+0x0): undefined reference to `coapServer::coapServer()'
c:/users/maxi/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp01\src\CoapServerEsp8266.cpp.o:(.text.startup._GLOBAL__sub_I_coap+0xf): undefined reference to `coapServer::coapServer()'
collect2.exe: error: ld returned 1 exit status
When I placed the coap_server.cpp
and coap_server.h
files in the project’s src/
directory and recompiled, it compiled.
DATA: [=== ] 34.2% (used 28024 bytes from 81920 bytes)
PROGRAM: [====== ] 63.3% (used 274732 bytes from 434160 bytes)
[SUCCESS] Took 11.03 seconds
So just put the needed coap_server.*
files in the src directory oO?