Marlin: Can't compile any more

Created on 27 Sep 2014  路  5Comments  路  Source: MarlinFirmware/Marlin

I am using the HEAD version of the code and arduino 1.0.5. Is marlin not compatible with my arduino version?

In file included from SdFile.h:27:0,
                 from cardreader.h:8,
                 from ultralcd.cpp:6:
SdBaseFile.h:38:8: error: using typedef-name 'fpos_t' after 'struct'
 struct fpos_t {
        ^
In file included from Marlin.h:10:0,
                 from temperature.h:24,
                 from ultralcd.cpp:1:
/usr/avr/include/stdio.h:947:19: note: 'fpos_t' has a previous declaration here
 typedef long long fpos_t;
                   ^

Most helpful comment

I have the same problem. I believe the problem is caused by a new release of avr-libc, where a type with the same name as the one used in sdfat library is introduced.

In upstream SdFat this struct has been renamed to FatPos_t: https://github.com/greiman/SdFat/blob/master/SdFat/SdBaseFile.h#L60
Either do a search&replace in SdBaseFile.{h, cpp} and replace fpos_t with FatPos_t or sed it:

sed -i 's/fpos_t/FatPos_t/' SdBaseFile.h

sed -i 's/fpos_t/FatPos_t/' SdBaseFile.cpp

All 5 comments

I have the same problem. I believe the problem is caused by a new release of avr-libc, where a type with the same name as the one used in sdfat library is introduced.

In upstream SdFat this struct has been renamed to FatPos_t: https://github.com/greiman/SdFat/blob/master/SdFat/SdBaseFile.h#L60
Either do a search&replace in SdBaseFile.{h, cpp} and replace fpos_t with FatPos_t or sed it:

sed -i 's/fpos_t/FatPos_t/' SdBaseFile.h

sed -i 's/fpos_t/FatPos_t/' SdBaseFile.cpp

Great! Works perfect, thanks!
Will this change be fixed upstream?

Another note- this only affects builds with SDSUPPORT on. If you don't need SD support, you can compile without SD support on systems with latest avr-libc.

please open a new issue if this is still present in the current bug fixing branch

https://github.com/ErikZalm/Marlin/tree/Marlin-v1-bug-fixing

i''m new, thats a tool i can use more often .. find and replace a text .
worked for me on the marlin code thanx

Was this page helpful?
0 / 5 - 0 ratings