Go Down

Topic: declarations in libraries (Read 1 time) previous topic - next topic

PaulS

Quote
Uh ? Are you saying class definitions and variable declarations are the same thing ?

No, I never said that. I'm asking, if you don't like declaring variables in the header file, how you feel about defining classes in header files.

I'm trying to determine whether to take you seriously.

tuxduino

#11
Jan 24, 2013, 03:07 pm Last Edit: Jan 24, 2013, 04:14 pm by tuxduino Reason: 1

Quote
Uh ? Are you saying class definitions and variable declarations are the same thing ?

No, I never said that. I'm asking, if you don't like declaring variables in the header file, how you feel about defining classes in header files.


I'm sorry, that's nonsense. Declaration != definition. Classes are defined in header files. Variables should be declared in .cpp files.

You didn't comment on the EEPROM example.


I'm trying to determine whether to take you seriously.


I will ignore personal attacks.


(edit: typo)

michinyon

Quote
What does your sketch look like? Are you including Ethernet.h in the sketch?

No....  And that was the problem!  Thanks


Eh???  It looks like it is there in your code,  in your second post on this thread.

PaulS

Quote
It looks like it is there in your code,  in your second post on this thread.

The Ethernet.h files was included in the library, as it needs to be. But, it was not included in the sketch.

The Arduino IDE copies files to another directory for compiling. What it copies are the header files included in the sketch plus the sketch plus any source files that go with the header files, plus any other files in the sketch directory.

What it does not copy are header files referenced in other files in the sketch directory. So, since the sketch didn't include Ethernet.h, that file was not copied to the build directory, so it was not available for the library to include/use, so the symbols defined in it were not available. IPAddress is one of those symbols.

PaulS

Quote
I will ignore personal attacks.

It was not a personal attack. I'm just trying to understand your position. It is not common practice.

Go Up