Go Down

Topic: Wire.h error working with Eclipse (Read 802 times) previous topic - next topic

licarion85

Hi everyone,

I am working in a project with Eclipse and I need the I2C bus to communicate with several peripherals. For that reason I have imported into my Eclipse project the Wire.h library from Arduino. The problem is when I try to compile the project, and error appears in the Wire.h file. It says something like:

"TwoWire must implement the inherited pure virtual method 'Print::write'"

Anyone can help me with this preoblem because I do not know how to solve it?

PaulS

Quote
I have imported into my Eclipse project the Wire.h library from Arduino.

From which version?

Quote
It says something like

We don't really care what you think the message was. We want to know EXACTLY what the message was.

Quote
Anyone can help me with this preoblem because I do not know how to solve it?

Is this a question? If so what is the question?

Making Wire.cpp actually implement Print::write() doesn't seem that difficult (or necessary, probably).

licarion85

The version is the 1.0.5.

The error which appears in Wire.h when I compile the project is:

"The type 'TwoWire' must implement the inherited pure virtual method 'Print::write'"

I am asking for help if anyone knows how to solve this issue in the Wire.h library.

Thank you for the response.

PaulS

Does your sketch compile in the IDE?

pylon

Wire.cpp does implement that method. Did you include that into your Eclipse project (as well as the also needed twi.c and twi.h)?

licarion85

Yes, my project compiles in the IDE and I have included the file Wire.cpp as well.


Nick Gammon

Can you post your code rather than just referring to it as "my project"?
http://www.gammon.com.au/electronics

Headroom

If you are using the Arduino Eclipse Plugin there are provisions made to import a complete library not just a particular file out of the library.
Highlight your project and select "import". That will present you with a selfexplanatory selection to either " import a folder containing source code ...." Or "import Arduino libraries...".
When selecting the latter it will present a list of all the libraries that come with the Arduino IDE and all the libraries in your personal libraries folder.
http://trippylighting.com

http://ledshield.wordpress.com/

Go Up