1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Solved Arduino won't compile

Discussion in 'Troubleshooting' started by mluschek, Aug 28, 2017.

Thread Status:
Not open for further replies.
  1. mluschek

    mluschek New Member

    Joined:
    Aug 28, 2017
    Messages:
    5
    Likes Received:
    2
    Apologies if this has been posted but I dug around for hours and I'm still not finding an answer..

    I recently got a used Robo R1+Plus, and it wasn't quite leveling properly and so I thought it might need an update to the auto leveling. (maybe it was something else, but here's where I'm at).. I was able to upload the Beta Auto Leveling software through Arduino, but now it's super jacked. The z-axis switches seem to be reversed. I was able to find info on this, that it's a problem with the Beta. Well, I tried to upload a different version (I'm not sure if I have 8mm rods or 5/16 rods) but it won't even compile without erroring out, let alone upload to the printer.

    I'm on a mac running Sierra, and tried all kinds of versions of Arduino. Anyone have any thoughts?

    Here's the error:

    Code:
    Arduino: 1.8.1 (Mac OS X), Board: "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: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:
    /Users/mathewluschek/Library/Arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/avr/include/stdio.h:950:33: note: 'fpos_t' has a previous declaration here
    __extension__ typedef long long fpos_t;
                                     ^
    Multiple libraries were found for "LiquidCrystal.h"
    Used: /Users/mathewluschek/Documents/Arduino/libraries/LiquidCrystal
    Not used: /private/var/folders/vk/3705b65n7w9bbtknnph2vp080000gn/T/AppTranslocation/2B8AA3A9-7D67-43F3-9D2D-6F8D3DE512AF/d/Arduino 3.app/Contents/Java/libraries/LiquidCrystal
    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.
    
     
  2. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,914
    Likes Received:
    7,338
  3. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,914
    Likes Received:
    7,338
    Just FYI: this google search would have returned those threads as a top hit (one of the first few):

    site:community.robo3d.com SdBaseFile.h:38: error: using typedef-name 'fpos_t' after 'struct'

    The forum search is quite junk... so no surprise that wouldn't help much
     
  4. mluschek

    mluschek New Member

    Joined:
    Aug 28, 2017
    Messages:
    5
    Likes Received:
    2
    "you can "do a search&replace in SdBaseFile.{h, cpp} and replace fpos_t with FatPos_t""

    Yeah, I tried this before asking here as well, no dice.

    I'm trying yet a different version of Arduino but of course it needs some kinda Java Runtime that Mac doesn't have anymore, so now I'm waiting for that to dl.. we'll see if that works.
     
  5. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,914
    Likes Received:
    7,338
    You will need to be a lot more specific on the errors then -- On the PC that change will allow it to compile in the latest version of the Arduino compiler. Here is the output from version 1.8.3:

    C:\Users\markt\Documents\Arduino\libraries\U8glib\utility\u8g_rot.c:48:1: warning: (near initialization for 'u8g_dev_rot.dev_fn')

    Sketch uses 131874 bytes (51%) of program storage space. Maximum is 253952 bytes.
    Global variables use 4772 bytes (58%) of dynamic memory, leaving 3420 bytes for local variables. Maximum is 8192 bytes.


    You might get a number of warnings like that first line, they are fine. They are merely warnings. No errors. Other warnings might look like this:

    sketch\pins.h:2566:0: warning: "Z_MAX_PIN" redefined

    #define Z_MAX_PIN -1

    ^

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

    from sketch\watchdog.cpp:1:


    Also ignorable

    UG8LIB must be included of course if you use an full graphics LCD, otherwise that is not needed
     
  6. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,914
    Likes Received:
    7,338
    If you can find an old enough version of the Arduino IDE it will build clean :) I usually don't bother.

    Regardless after the code change mentioned this error will be gone:

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

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,914
    Likes Received:
    7,338
    In fact attached are the edited files just put them in the project folder and overwrite the old ones
     

    Attached Files:

  8. mluschek

    mluschek New Member

    Joined:
    Aug 28, 2017
    Messages:
    5
    Likes Received:
    2
    Yeah, that worked. I had to use Arduino 1.0.6 and install Java Runtime from Apple. It compiled and uploaded.
     
    mark tomlinson likes this.
  9. mluschek

    mluschek New Member

    Joined:
    Aug 28, 2017
    Messages:
    5
    Likes Received:
    2
    Code:
    Here are the links to the files:
    https://www.arduino.cc/en/Main/Donate
    and
    https://support.apple.com/kb/DL1572?locale=en_US
     
    mark tomlinson likes this.
  10. mluschek

    mluschek New Member

    Joined:
    Aug 28, 2017
    Messages:
    5
    Likes Received:
    2
  11. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,914
    Likes Received:
    7,338
Thread Status:
Not open for further replies.

Share This Page