Pages: [1]   Go Down
Author Topic: Wire.h error working with Eclipse  (Read 779 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 640
Posts: 50335
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 640
Posts: 50335
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Does your sketch compile in the IDE?
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 111
Posts: 5242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 502
Posts: 19085
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you post your code rather than just referring to it as "my project"?
Logged


Offline Offline
Sr. Member
****
Karma: 7
Posts: 292
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Pages: [1]   Go Up
Jump to: