But when I try to instantiate an object, I get this error: "Files\arduino-0022\libraries\Ardumote\ComEthernetIRC.cpp:9: error: no match for call to '(Client) (byte*&, int)'"
Class constructors can only be called when the instance of that class is created. And as far as I can tell, the Client class provides no other method of assigning its IP and port numbers.
So, you can't define a Client object, and then call it's constructor later to configure it.
Delta_G:
Depending on what the constructor does, you can
client = Client(a, b);
That would create a new instance of Client and then assign it to the existing instance client.
I tried but it also throws an error: "Ardumote\ComEthernetIRC.cpp.o: In function ComEthernetIRC': C:\Programme\arduino-0022\libraries\Ardumote/ComEthernetIRC.cpp:4: undefined reference to Client::Client()'"
The other option would be to have a function in the class Client that can set the variables for you.
It's the arduino ethernet libary's Client class and as jraskell already said it doesn't have a setter method (btw. is that bad design? should that be refactored?)
Maybe I could pass a client instance to the setup method... I'll try that...
Edit:
This throws the same "undefined reference to `Client::Client()" error.
The simplest thing is to use the new operator (code for which you have to supply) and then defer creating the instance of Client until you are ready. This compiles: