Welcome! Log In Create A New Profile

Advanced

error: using typedef-name 'fpos_t' after 'struct'

Posted by enhadi 
error: using typedef-name 'fpos_t' after 'struct'
July 25, 2016 02:08PM
using typedef-name 'fpos_t' after 'struct'
Arduino: 1.6.10 Hourly Build 2016/07/25 04:33 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

sketch\Marlin_main.cpp:2070:36: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

LCD_MESSAGEPGM(MACHINE_NAME" "MSG_OFF".");

^

In file included from sketch\SdFile.h:27:0,

from sketch\cardreader.h:8,

from sketch\Marlin_main.cpp:44:

SdBaseFile.h:38: error: using typedef-name 'fpos_t' after 'struct'

struct fpos_t {

^

In file included from sketch\Marlin.h:10:0,

from sketch\Marlin_main.cpp:30:

c:\users\play\desktop\ramp 1.4\arduino-nightly-windows\arduino-nightly\hardware\tools\avr\avr\include\stdio.h:950:33: note: 'fpos_t' has a previous declaration here

__extension__ typedef long long fpos_t;

^

exit status 1
using typedef-name 'fpos_t' after 'struct'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Re: error: using typedef-name 'fpos_t' after 'struct'
July 26, 2016 11:02PM
why are you running an hourly build version of arduino?

"Arduino: 1.6.10 Hourly Build 2016/07/25"
Re: error: using typedef-name 'fpos_t' after 'struct'
July 28, 2016 08:40AM
I Have the same error, anybody know the solution? Please could you hellp me?

Arduino:1.6.9 (Windows 8.1), Scheda:"Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

In file included from sketch\SdFile.h:27:0,

                 from sketch\cardreader.h:8,

                 from sketch\Marlin_main.cpp:37:

SdBaseFile.h:38: error: using typedef-name 'fpos_t' after 'struct'

 struct fpos_t {

        ^

In file included from sketch\Marlin.h:10:0,

                 from sketch\Marlin_main.cpp:22:

c:\users\davide\appdata\local\arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2\avr\include\stdio.h:950:33: note: 'fpos_t' has a previous declaration here

 __extension__ typedef long long fpos_t;

                                 ^

exit status 1
using typedef-name 'fpos_t' after 'struct'

Re: error: using typedef-name 'fpos_t' after 'struct'
July 28, 2016 10:59PM
What variant of marlin are you using, where did you download it from?
[Solved] error: using typedef-name 'fpos_t' after 'struct'
July 29, 2016 09:50AM
Dear Dust,

I alredy solved the issue, I found many trouble and fixed as below:

  1. I use Arduino 1.0.6
  2. The file was corrupted

Now all works good. Thank you for your support thumbs upsmileys with beer

Edited 1 time(s). Last edit at 07/29/2016 09:51AM by davgiuffrida.
Re: error: using typedef-name 'fpos_t' after 'struct'
July 31, 2016 02:14PM
Hi All,

Having the same problem as the OP, but I seem to be less self-sufficient smiling smiley
Let me get this out of the way first--I really suck at coding. My modified Kossel was first run using the Blomker software package. The printer ran ok, but I kind of lost interest and it has been sitting since before Christmas.

I got a new computer and failed to transfer all the needed files from the old one. I downloaded the latest Marlin version and also got the Mini Kossel package from Builda3Dprinter.eu. I copied the info from the old config.h file into the new download, but I can't get it to compile.

Below is my error message. Can anyone see what I need to do?
___________
Arduino: 1.6.10 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Build options changed, rebuilding all
In file included from sketch\Marlin.h:21:0,

from sketch\ConfigurationStore.cpp:1:

sketch\fastio.h:1418:0: warning: "DIO73_PIN" redefined

#define DIO73_PIN PINJ4

^

sketch\fastio.h:1406:0: note: this is the location of the previous definition

#define DIO73_PIN PINJ3

^

In file included from sketch\Marlin.h:21:0,

from sketch\thermistortables.h:4,

from sketch\Configuration.h:586,

from C:\Users\sstory.MERKLE\Downloads\Kossel Mini\Marlin\Marlin.ino:33:

sketch\fastio.h:1418:0: warning: "DIO73_PIN" redefined

#define DIO73_PIN PINJ4

^

sketch\fastio.h:1406:0: note: this is the location of the previous definition

#define DIO73_PIN PINJ3

^

In file included from sketch\Marlin.h:21:0,

from sketch\MarlinSerial.cpp:23:

sketch\fastio.h:1418:0: warning: "DIO73_PIN" redefined

#define DIO73_PIN PINJ4

^

sketch\fastio.h:1406:0: note: this is the location of the previous definition

#define DIO73_PIN PINJ3

^

In file included from sketch\Marlin.h:21:0,

from sketch\Marlin_main.cpp:30:

sketch\fastio.h:1418:0: warning: "DIO73_PIN" redefined

#define DIO73_PIN PINJ4

^

sketch\fastio.h:1406:0: note: this is the location of the previous definition

#define DIO73_PIN PINJ3

^

sketch\Marlin_main.cpp:1609:36: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

LCD_MESSAGEPGM(MACHINE_NAME" "MSG_OFF".");

^

In file included from sketch\SdFile.h:27:0,

from sketch\cardreader.h:8,

from sketch\Marlin_main.cpp:37:

SdBaseFile.h:38: error: using typedef-name 'fpos_t' after 'struct'

struct fpos_t {

^

In file included from sketch\Marlin.h:10:0,

from sketch\Marlin_main.cpp:30:

c:\program files (x86)\arduino\hardware\tools\avr\avr\include\stdio.h:950:33: note: 'fpos_t' has a previous declaration here

__extension__ typedef long long fpos_t;

^

exit status 1
using typedef-name 'fpos_t' after 'struct'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Re: error: using typedef-name 'fpos_t' after 'struct'
July 31, 2016 04:02PM
Quote
sstory0626
Hi All,

Having the same problem as the OP, but I seem to be less self-sufficient smiling smiley
Let me get this out of the way first--I really suck at coding. My modified Kossel was first run using the Blomker software package. The printer ran ok, but I kind of lost interest and it has been sitting since before Christmas.

I got a new computer and failed to transfer all the needed files from the old one. I downloaded the latest Marlin version and also got the Mini Kossel package from Builda3Dprinter.eu. I copied the info from the old config.h file into the new download, but I can't get it to compile.

Below is my error message. Can anyone see what I need to do?
___________
Arduino: 1.6.10 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Build options changed, rebuilding all
In file included from sketch\Marlin.h:21:0,

from sketch\ConfigurationStore.cpp:1:

sketch\fastio.h:1418:0: warning: "DIO73_PIN" redefined

#define DIO73_PIN PINJ4

^

sketch\fastio.h:1406:0: note: this is the location of the previous definition

#define DIO73_PIN PINJ3

^

In file included from sketch\Marlin.h:21:0,

from sketch\thermistortables.h:4,

from sketch\Configuration.h:586,

from C:\Users\sstory.MERKLE\Downloads\Kossel Mini\Marlin\Marlin.ino:33:

sketch\fastio.h:1418:0: warning: "DIO73_PIN" redefined

#define DIO73_PIN PINJ4

^

sketch\fastio.h:1406:0: note: this is the location of the previous definition

#define DIO73_PIN PINJ3

^

In file included from sketch\Marlin.h:21:0,

from sketch\MarlinSerial.cpp:23:

sketch\fastio.h:1418:0: warning: "DIO73_PIN" redefined

#define DIO73_PIN PINJ4

^

sketch\fastio.h:1406:0: note: this is the location of the previous definition

#define DIO73_PIN PINJ3

^

In file included from sketch\Marlin.h:21:0,

from sketch\Marlin_main.cpp:30:

sketch\fastio.h:1418:0: warning: "DIO73_PIN" redefined

#define DIO73_PIN PINJ4

^

sketch\fastio.h:1406:0: note: this is the location of the previous definition

#define DIO73_PIN PINJ3

^

sketch\Marlin_main.cpp:1609:36: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

LCD_MESSAGEPGM(MACHINE_NAME" "MSG_OFF".");

^

In file included from sketch\SdFile.h:27:0,

from sketch\cardreader.h:8,

from sketch\Marlin_main.cpp:37:

SdBaseFile.h:38: error: using typedef-name 'fpos_t' after 'struct'

struct fpos_t {

^

In file included from sketch\Marlin.h:10:0,

from sketch\Marlin_main.cpp:30:

c:\program files (x86)\arduino\hardware\tools\avr\avr\include\stdio.h:950:33: note: 'fpos_t' has a previous declaration here

__extension__ typedef long long fpos_t;

^

exit status 1
using typedef-name 'fpos_t' after 'struct'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Hi,

about my experience I can suggest you two way.

Can you try whit other new file, may it should be corrupted
Second one, try with IDE Arduino 1.0.6 version.

Good luck!! ;-)

Edited 1 time(s). Last edit at 07/31/2016 04:02PM by davgiuffrida.
Re: error: using typedef-name 'fpos_t' after 'struct'
July 31, 2016 09:32PM
@davgiuffrida,

Thanks for the tip! I went back to 1.0.6 and it compiles now.

That's kind if annoying--there must be different commands in later versions?

Shawn
Re: error: using typedef-name 'fpos_t' after 'struct'
August 14, 2016 09:50AM
There is another workaround. You can still use the new versions of Arduino like 1.6.10.

Rename fpos_t variables in SdBaseFile.h and SdBaseFile.cpp to another name like fpos_t1 and recompile. Problem is in C++ you can not use typedef and struct for the same varibale name.

fpos_t is already defined in stdio.h which is a hardware library file for arduino.

Can
Re: error: using typedef-name 'fpos_t' after 'struct'
September 14, 2016 08:55PM
Dear webliya, I tried to rename fpos_t variables in SdBaseFile.h and SdBaseFile.cpp to another name like fpos_t1 and recompile but whan I use IDE 1.6.11 an error message appaear (please, see picture attached): Error during download of scketch. If I use the IDE 1.0.6 no error message appear.



Edited 1 time(s). Last edit at 09/14/2016 08:55PM by davgiuffrida.
Re: error: using typedef-name 'fpos_t' after 'struct'
November 04, 2016 10:36AM
Wow! so after posting the link last night, I read through the comments on the firmware it referenced. Everyone was barking about it not compiling and such when I saw a tiny "I figured it out!" in the replies. Following it said they got the firmware to compile and it actually worked on the board, adjustments in play and all they did differently was use Arduino ver. 1.0.6.
Immediately d/l'd the version and firmware, which compiled easily, btw, and ran, not walked to my HICTOP, which took it as advertised. I even went in after that and corrected my stepper direction and viola, it compiled and uploaded!

NOW, there's a MINTEMP Err issue to be sussed out but I forsee that being a fairly straightforward fix, as I'm finding a lot of it about.

[www.thingiverse.com] down after all the bold caps entries on the 17th of Oct by bandonj.


Hoping this helps,

bux
Re: error: using typedef-name 'fpos_t' after 'struct'
November 08, 2016 10:21PM
Good news: The firmware compiles perfectly well on Arduino 1.6.11 after manually changing all instances of "fpos_t" to "fpost"
Bad news: The AutoHome grinds in the Y-Axis...and I could use some help. I'm posting a new general question on it with more details ("Marlin Rough Steppers & Failed AutoHome"). Thanks to anyone who can help.
Re: error: using typedef-name 'fpos_t' after 'struct'
November 19, 2016 08:05AM
Quote
Alexandria_Al
Good news: The firmware compiles perfectly well on Arduino 1.6.11 after manually changing all instances of "fpos_t" to "fpost"
Bad news: The AutoHome grinds in the Y-Axis...and I could use some help. I'm posting a new general question on it with more details ("Marlin Rough Steppers & Failed AutoHome"). Thanks to anyone who can help.

Super answer bro thanks smiling smiley thumbs upsmiling smileysmileys with beer
Re: error: using typedef-name 'fpos_t' after 'struct'
April 10, 2017 12:34PM
Eight months after the first posting of this problem, no one has fixed it officially. Bummer.
Obviously I have this problem or I would not have posted. :-)
I got my copy of the Marlin sketch from FolgerTech when I got my Kossel 2020 Rev B kit from them.
I am using Arduino 1.8.2 on a Win 7 system. Getting the exact same errors. I have a couple of questions for those that have applied the fix for the duplicate definition of "fpos_t".

Did this fix your problem without generating other problems in other parts of the code?
Were any more subtle problems found with this code?
If any answers to the previous two problems are "yes", is the current solution only to go back and find Arduino 1.0.6 to get the code to work properly?



** An apparently globally visible define assigned to two different pins. This is not likely to do what at least one author wants done...
sketch\fastio.h:1418:0: warning: "DIO73_PIN" redefined
#define DIO73_PIN PINJ4

sketch\fastio.h:1406:0: note: this is the location of the previous definition
#define DIO73_PIN PINJ3

** A #define that someone is used like a variable assignment! This is a very rookie error that is only giving a warning, it should be an error.
In file included from sketch\Marlin.h:22:0,
from sketch\Sd2Card.cpp:20:
sketch\Configuration.h:354:32: warning: ISO C99 requires whitespace after the macro name
#define Z_RAISE_BETWEEN_PROBING=20

I will see if these can be safely corrected, but nothing is more frustrating that dealing with someone else's (uncommented) code.

Many thanks from a new Kossel Delta printer kit builder!
DLC

Edited 1 time(s). Last edit at 04/10/2017 12:56PM by dlc60.
Re: error: using typedef-name 'fpos_t' after 'struct'
April 10, 2017 06:19PM
The issue is FolgerTech, they are providing a really old un patched version of marlin.

The real marlin repository has had this fixed for years.


Renaming fpos_t variables in SdBaseFile.h and SdBaseFile.cpp to another name like filepos_t fixes it fully.

The issue is that old versions of marlin used the variable name fpos_t but newer version of Arduino grabbed this name as a reserved structure causing the old marlin to fail to compile.

Edited 1 time(s). Last edit at 04/10/2017 06:19PM by Dust.
Re: error: using typedef-name 'fpos_t' after 'struct'
April 11, 2017 12:10AM
Hmm. That does not surprise me. Once someone hacks their specific setups into code they are reluctant to change. I think that I'll do the changes and see how it works. There is a "double #define, which is just dumb since they are about 10 lines apart, a _really_ rookie #define with an "=" in it and finally a poorly quoted string literal. Pretty easy fixes those are. Then I'll move the config.h over to a new version AFTER I get the printer working with a known piece of code.

Is there anything in the newer versions that changes performance significantly? I'll need to make all the changes that define the thermister locations, stepper locations, Zmin, end stops etc...

Thanks for the comments,
DLC
Re: error: using typedef-name 'fpos_t' after 'struct'
January 28, 2018 04:21AM
Re: error: using typedef-name 'fpos_t' after 'struct'
January 28, 2018 06:53AM
So, it means need the Arduino IDE 1.0.6 version. But why the last version can not be use?
Re: error: using typedef-name 'fpos_t' after 'struct'
January 29, 2018 11:29AM
yah ..thats the problem..its working with the older version..but not with the latest..i don't know why..
Re: error: using typedef-name 'fpos_t' after 'struct'
January 30, 2018 05:13AM
Because the newer version of the ardunio IDE "fpos_t" became a reserved word. Any older firmware that used it was just bad luck.

All you need do is rename "fpos_t" to something else, commonly "filepos_t"


Dont use the older version of the ardiuno IDE, that is just going backwards. It loses lots of optimisations and bug fixes.
Re: error: using typedef-name 'fpos_t' after 'struct'
January 30, 2018 09:48AM
This is what I did. I got the new IDE, fixed the fpos problem and all went just fine.
Folger Tech is still using the ancient source as well.

DLC
Sorry, only registered users may post in this forum.

Click here to login