Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 14 of 14

Thread: Another library fails to compile… any ideas why?

  1. #1
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,408

    Another library fails to compile… any ideas why?

    EEPROMEx is a really neat library, allowing the quick and easy writing of just about any type of variable or array to EEPROM.

    Trouble is, it will compile just fine on an AVR but fails on the Teensy 3… error code follows:
    Code:
    In file included from EEPROMEx.ino:9:0:
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:23:20: fatal error: EEPROM.h: No such file or directory
    compilation terminated.
    The weird thing is that EEPROM.h is present in my list of libraries (Teensy 1.17 + Arduino 1.05). Any idea what might be going on?

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,956
    Try adding an explicit:

    Code:
    #include <EEPROM.h>
    before the include of EEPROMEx.h. This sometimes helps when the IDE can't deduce it needs to include EEPROM.h on its own.

  3. #3
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,408

    Cool You are fantastic - thanks!

    So, now the Example file included with the library no longer complains about the lack of EEPROM.h. However, it still fails to compile and unfortunately, this is way over my head. The most I got into CS was intro to program and data types was the next class. I presume the below makes a lot more sense to the likes of you, who will forget more about C in a given day than I'll ever know.

    Code:
    In file included from EEPROMEx.ino:9:0:
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:51:26: warning: ISO C99 requires whitespace after the macro name [enabled by default]
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:51:0: warning: "EEPROMSizeTeensy1" redefined [enabled by default]
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:50:0: note: this is the location of the previous definition
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:53:26: warning: ISO C99 requires whitespace after the macro name [enabled by default]
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:53:0: warning: "EEPROMSizeTeensy2" redefined [enabled by default]
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:52:0: note: this is the location of the previous definition
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:54:0: warning: "EEPROMSizeTeensy3" redefined [enabled by default]
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:39:0: note: this is the location of the previous definition
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMEx.h:166:22: error: conflicting declaration 'EEPROMClassEx EEPROM'
    In file included from EEPROMEx.ino:8:0:
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROM/EEPROM.h:39:20: error: 'EEPROM' has a previous declaration as 'EEPROMClass EEPROM'
    EEPROMEx.ino: In function 'void readAndWriteInt()':
    EEPROMEx:80: error: 'class EEPROMClass' has no member named 'writeInt'
    EEPROMEx:81: error: 'class EEPROMClass' has no member named 'readInt'
    EEPROMEx.ino: In function 'void readAndWriteLong()':
    EEPROMEx:100: error: 'class EEPROMClass' has no member named 'writeLong'
    EEPROMEx:101: error: 'class EEPROMClass' has no member named 'readLong'
    EEPROMEx.ino: In function 'void readAndWriteFloat()':
    EEPROMEx:120: error: 'class EEPROMClass' has no member named 'writeFloat'
    EEPROMEx:121: error: 'class EEPROMClass' has no member named 'readFloat'
    EEPROMEx.ino: In function 'void updateAndReadDouble()':
    EEPROMEx:140: error: 'class EEPROMClass' has no member named 'updateDouble'
    EEPROMEx:141: error: 'class EEPROMClass' has no member named 'readDouble'
    EEPROMEx.ino: In function 'void writeAndReadCharArray()':
    EEPROMEx:161: error: 'class EEPROMClass' has no member named 'writeBlock'
    EEPROMEx:161: error: expected primary-expression before 'char'
    EEPROMEx:161: error: expected ';' before 'char'
    EEPROMEx:162: error: 'class EEPROMClass' has no member named 'readBlock'
    EEPROMEx:162: error: expected primary-expression before 'char'
    EEPROMEx:162: error: expected ';' before 'char'
    EEPROMEx.ino: In function 'void writeAndReadByteArray()':
    EEPROMEx:184: error: 'class EEPROMClass' has no member named 'writeBlock'
    EEPROMEx:184: error: expected primary-expression before '>' token
    EEPROMEx.ino:184:47: warning: left operand of comma operator has no effect [-Wunused-value]
    EEPROMEx.ino:184:56: warning: right operand of comma operator has no effect [-Wunused-value]
    EEPROMEx:185: error: 'class EEPROMClass' has no member named 'updateBlock'
    EEPROMEx:185: error: expected primary-expression before '>' token
    EEPROMEx.ino:185:67: warning: left operand of comma operator has no effect [-Wunused-value]
    EEPROMEx.ino:185:74: warning: right operand of comma operator has no effect [-Wunused-value]
    EEPROMEx:186: error: 'class EEPROMClass' has no member named 'readBlock'
    EEPROMEx:186: error: expected primary-expression before '>' token
    EEPROMEx.ino:186:46: warning: left operand of comma operator has no effect [-Wunused-value]
    EEPROMEx.ino:186:54: warning: right operand of comma operator has no effect [-Wunused-value]
    EEPROMEx.ino: In function 'void waitUntilReady()':
    EEPROMEx:212: error: 'class EEPROMClass' has no member named 'writeByte'
    EEPROMEx:216: error: 'class EEPROMClass' has no member named 'isReady'
    EEPROMEx:225: error: 'class EEPROMClass' has no member named 'writeLong'
    EEPROMEx:229: error: 'class EEPROMClass' has no member named 'isReady'
    EEPROMEx:237: error: 'class EEPROMClass' has no member named 'readLong'
    EEPROMEx:241: error: 'class EEPROMClass' has no member named 'isReady'
    EEPROMEx:256: error: 'class EEPROMClass' has no member named 'writeBlock'
    EEPROMEx:256: error: expected primary-expression before '>' token
    EEPROMEx.ino:256:47: warning: left operand of comma operator has no effect [-Wunused-value]
    EEPROMEx.ino:256:55: warning: right operand of comma operator has no effect [-Wunused-value]
    EEPROMEx:263: error: 'class EEPROMClass' has no member named 'updateBlock'
    EEPROMEx:263: error: expected primary-expression before '>' token
    EEPROMEx.ino:263:48: warning: left operand of comma operator has no effect [-Wunused-value]
    EEPROMEx.ino:263:59: warning: right operand of comma operator has no effect [-Wunused-value]
    EEPROMEx:270: error: 'class EEPROMClass' has no member named 'updateBlock'
    EEPROMEx:270: error: expected primary-expression before '>' token
    EEPROMEx.ino:270:48: warning: left operand of comma operator has no effect [-Wunused-value]
    EEPROMEx.ino:270:59: warning: right operand of comma operator has no effect [-Wunused-value]
    EEPROMEx:277: error: 'class EEPROMClass' has no member named 'readBlock'
    EEPROMEx:277: error: expected primary-expression before '>' token
    EEPROMEx.ino:277:46: warning: left operand of comma operator has no effect [-Wunused-value]
    EEPROMEx.ino:277:54: warning: right operand of comma operator has no effect [-Wunused-value]
    EEPROMEx.ino: In function 'void errorChecking(int)':
    EEPROMEx:291: error: 'class EEPROMClass' has no member named 'writeLong'
    EEPROMEx:297: error: 'class EEPROMClass' has no member named 'writeLong'
    EEPROMEx.ino: In function 'void setup()':
    EEPROMEx:309: error: 'class EEPROMClass' has no member named 'setMemPool'
    EEPROMEx:313: error: 'class EEPROMClass' has no member named 'setMaxAllowedWrites'
    EEPROMEx:318: error: 'class EEPROMClass' has no member named 'getAddress'
    EEPROMEx:319: error: 'class EEPROMClass' has no member named 'getAddress'
    EEPROMEx:320: error: 'class EEPROMClass' has no member named 'getAddress'
    EEPROMEx:321: error: 'class EEPROMClass' has no member named 'getAddress'
    EEPROMEx:322: error: 'class EEPROMClass' has no member named 'getAddress'
    EEPROMEx:323: error: 'class EEPROMClass' has no member named 'getAddress'
    EEPROMEx:324: error: 'class EEPROMClass' has no member named 'getAddress'

  4. #4
    Senior Member jimmayhugh's Avatar
    Join Date
    Nov 2012
    Posts
    168
    I use this bit of code to save and retrieve my data structures to and from the Teensy 3.0. Hasn't failed me yet...

  5. #5
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,408
    Quote Originally Posted by jimmayhugh View Post
    I use this bit of code to save and retrieve my data structures to and from the Teensy 3.0. Hasn't failed me yet...
    And seems to work like a charm! You are the best! Thank you!

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,069
    I'm looking into the EEPROMEx library now. There are multiple problems. I hope to have fixes soon....

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,069
    Turns out there's a github repository for this library. I committed fixes here:

    https://github.com/PaulStoffregen/Ar...aster/EEPROMEx

    I'll also attach my patched copy to this message.

    Teensy3 was missing one of the seldom-used AVR libc EEPROM library functions. I've added it. You'll need these 2 files, which go into hardware/teensy/cores/teensy3.

    https://github.com/PaulStoffregen/co...vr_functions.h
    https://github.com/PaulStoffregen/co...ensy3/eeprom.c

    With these 2 files (which I'll put in all future Teensyduino installers) and the patched library, it should compile and (hopefully) work correctly.

    Please let me know how this works for you?
    Attached Files Attached Files

  8. #8
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    955
    Quote Originally Posted by PaulStoffregen View Post
    Please let me know how this works for you?
    I tried to compile the library you posted and it still gives error with the example programs under teensduino-1.17rc2 and arduino1.0.5. I made no changes to anything, just installed the library.
    Here are the error's:

    EEPROMEx.pde
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMex.cpp: In member function 'bool EEPROMClassEx::isReady()':
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMex.cpp:91:25: error: 'eeprom_is_ready' was not declared in this scope
    EEPROMBackup.pde
    In file included from EEPROMBackup.pde:18:0:
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMBackupVar.h: In constructor 'EEPROMBackupVar<T>::EEPROMBackupVar(T, int, compareFunction, long unsigned int)':
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMBackupVar.h:41:24: error: 'class EEPROMClassEx' has no member named 'getAdress'
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMBackupVar.h: In member function 'void EEPROMBackupVar<T>::initialize(T)':
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMBackupVar.h:48:24: error: 'class EEPROMClassEx' has no member named 'getAdress'
    EEPROMVar.pde
    In file included from EEPROMVar.pde:10:0:
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMvar.h: In constructor 'EEPROMVar<T>::EEPROMVar(T)':
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMvar.h:29:20: error: 'class EEPROMClassEx' has no member named 'getAdress'

  9. #9
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    955
    nevermind I didn't install the updated core files that you clearly stated needed to be installed, too much turkey!

  10. #10
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    955
    Quote Originally Posted by duff View Post
    nevermind I didn't install the updated core files that you clearly stated needed to be installed, too much turkey!
    ok i spoke too soon, EEPROMEx.pde compiles fine but the other two examples do not. I updated the eeprom.c and avr_functions.h core files.

    EEPROMBackup.pde errors
    In file included from EEPROMBackup.pde:18:0:
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMBackupVar.h: In constructor 'EEPROMBackupVar<T>::EEPROMBackupVar(T, int, compareFunction, long unsigned int)':
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMBackupVar.h:41:24: error: 'class EEPROMClassEx' has no member named 'getAdress'
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMBackupVar.h: In member function 'void EEPROMBackupVar<T>::initialize(T)':
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMBackupVar.h:48:24: error: 'class EEPROMClassEx' has no member named 'getAdress'
    EEPROMVar.pde errors
    In file included from EEPROMVar.pde:10:0:
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMvar.h: In constructor 'EEPROMVar<T>::EEPROMVar(T)':
    /Applications/Arduino.app/Contents/Resources/Java/libraries/EEPROMEx/EEPROMvar.h:29:20: error: 'class EEPROMClassEx' has no member named 'getAdress'
    haven't really looked into these errors yet.

  11. #11
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    955
    Am I the only one getting this error on the example programs?

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,069
    Opps, looks like I only tested 1 of the 3 examples!

    The other 2 have another problem, unrelated to Teensy. Looks like "getAdress" was at some point corrected for spelling to "getAddress", but it wasn't fully updated in all locations.

    Here's a patch to fix the problem:

    https://github.com/PaulStoffregen/Ar...46f9c86d4a755f

  13. #13
    Senior Member duff's Avatar
    Join Date
    Jan 2013
    Location
    Las Vegas
    Posts
    955
    So I got EEPROMBackup to compile. There was a spelling error in EEPROMBackupVar.h line 41 & 48:
    Code:
    41: baseAddress = EEPROM.getAdress(sizeof(T)*adressRange);
    48: baseAddress = EEPROM.getAdress(sizeof(T)*adressRange);
    Adress should be Address!

    That being said I'm still getting a error with EEPROMVar.pde:
    EEPROMVar.pde: In function 'void readAndWriteVar(EEPROMVar<float>&)':
    EEPROMVar:34: error: 'class EEPROMVar<float>' has no member named 'getAddress'
    So the float class does not support getAddress i guess, have to look into this also.

    haha, my dog was chewing my shoes when u replied.

  14. #14
    Junior Member
    Join Date
    Nov 2013
    Posts
    5
    Hi, Great to hear the library is being used! Paul submitted a bunch of fixes, so now the version on Github should not give any issues anymore. I will try to update the zip file later in the day.

    I would be very interested to hear what people use the library for. If you want please post a reaction on my blog.

    A side-note: I have removed the EEPROMBackupvar class for now. It is meant as a naive wear leveling mechanism, but this version only works in a limited set of cases. I'll change it into a more general version and re-add it when I have some time.

    Thijs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •