Hello everyone,
I'm trying to use <EtherCard.h> in Code::Blocks (Version 13.12 - Windows) but the compiler returns the error message below:
Test.ino: (.Text.setup + 0x2E) undefined reference to `EtherCard::begin(unsigned int, unsigned char const *, unsigned char)'
I've tried everything, but I can not compile successfully.
The same code works fine with the original Arduino IDE and also with Visual Micro (Arduino for Visual Studio).
But I want to use CodeBlocks which I love!
Does anyone know how to fix or give me an example of setting the correct environment CodeBlocks?
My simple code brief:
#include <Arduino.h>
#include <EtherCard.h>
#define BUF_SIZE 512
byte mymac[] = { 0x00, 0x04, 0xA3, 0x21, 0xCA, 0x38 }; // MAC address.
uint8_t myip[] = { 192, 168, 0, 171 }; // The IP address.
uint8_t dns[] = { 8, 8, 8, 8 }; // The DNS server address.
uint8_t gateway[] = { 192, 168, 0, 1 }; // The gateway router address.
uint8_t subnet[] = { 255, 255, 255, 0 }; // The subnet mask.
byte Ethernet::buffer[BUF_SIZE];
void setup()
{
...
if (ether.begin(sizeof Ethernet::buffer, mymac,10) == 0) // Pin 10 = CS
...
}
...
Thank you so much,
Botezelli