Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compling problem: missing needed include WProgram.h in Marlin.h:33 #2

Open
nodje opened this issue Mar 26, 2013 · 2 comments
Open

Compling problem: missing needed include WProgram.h in Marlin.h:33 #2

nodje opened this issue Mar 26, 2013 · 2 comments

Comments

@nodje
Copy link

nodje commented Mar 26, 2013

Hi,

I'm trying to compile the Marlin firmware with Arduino 1.0.3 and Gen7 Arduino IDE Support 2.1 files.

I've selected Gen7 with ATmega644P and 20MHz.

When I verify, I get the following bug:

In file included from cardreader.cpp:1: Marlin.h:33:26: error: WProgram.h: No such file or directory In file included from Marlin.h:41, from cardreader.cpp:1: MarlinSerial.h:119: error: expected ',' or '...' before '&' token MarlinSerial.h:119: error: ISO C++ forbids declaration of 'String' with no type MarlinSerial.h:138: error: expected ',' or '...' before '&' token MarlinSerial.h:138: error: ISO C++ forbids declaration of 'String' with no type MarlinSerial.h: In member function 'void MarlinSerial::print(int)': MarlinSerial.h:121: error: 's' was not declared in this scope In file included from cardreader.cpp:1: Marlin.h: In function 'void serialPrintFloat(float)': Marlin.h:115: error: call of overloaded 'print(int)' is ambiguous MarlinSerial.h:119: note: candidates are: void MarlinSerial::print(int) MarlinSerial.h:126: note: void MarlinSerial::print(const char*) <near match> MarlinSerial.h:130: note: void MarlinSerial::print(char, int) MarlinSerial.h:131: note: void MarlinSerial::print(unsigned char, int) MarlinSerial.h:132: note: void MarlinSerial::print(int, int) MarlinSerial.h:133: note: void MarlinSerial::print(unsigned int, int) MarlinSerial.h:134: note: void MarlinSerial::print(long int, int) MarlinSerial.h:135: note: void MarlinSerial::print(long unsigned int, int) MarlinSerial.h:136: note: void MarlinSerial::print(double, int) Marlin.h:118: error: call of overloaded 'print(int)' is ambiguous MarlinSerial.h:119: note: candidates are: void MarlinSerial::print(int) MarlinSerial.h:126: note: void MarlinSerial::print(const char*) <near match> MarlinSerial.h:130: note: void MarlinSerial::print(char, int) MarlinSerial.h:131: note: void MarlinSerial::print(unsigned char, int) MarlinSerial.h:132: note: void MarlinSerial::print(int, int) MarlinSerial.h:133: note: void MarlinSerial::print(unsigned int, int) MarlinSerial.h:134: note: void MarlinSerial::print(long int, int) MarlinSerial.h:135: note: void MarlinSerial::print(long unsigned int, int) MarlinSerial.h:136: note: void MarlinSerial::print(double, int) Marlin.h: At global scope: Marlin.h:124: error: variable or field 'manage_inactivity' declared void Marlin.h:124: error: 'byte' was not declared in this scope cardreader.cpp: In constructor 'CardReader::CardReader()': cardreader.cpp:29: error: 'millis' was not declared in this scope cardreader.cpp: In member function 'void CardReader::checkautostart(bool)': cardreader.cpp:419: error: 'millis' was not declared in this scope cardreader.cpp: In member function 'void CardReader::fast_xfer(char*)': cardreader.cpp:538: error: 'boolean' was not declared in this scope cardreader.cpp:538: error: expected;' before 'done'
cardreader.cpp:541: error: 'LOW' was not declared in this scope
cardreader.cpp:541: error: 'LOW' was not declared in this scope
cardreader.cpp:542: error: 'LOW' was not declared in this scope
cardreader.cpp:542: error: 'LOW' was not declared in this scope
cardreader.cpp:586: error: 'done' was not declared in this scope`

I have tried to get it compile by copying missing WProgram.h from sanguino/cores/arduino to /marlin root dir, but it produces another error:

In file included from Marlin.ino:51: /Applications/Arduino.app/Contents/Resources/Java/hardware/Gen7/variants/gen7/pins_arduino.h:50: error: redefinition of 'const uint8_t A0' WProgram.h:51: error: 'const uint8_t A0' previously defined here /Applications/Arduino.app/Contents/Resources/Java/hardware/Gen7/variants/gen7/pins_arduino.h:51: error: redefinition of 'const uint8_t A1' WProgram.h:52: error: 'const uint8_t A1' previously defined here /Applications/Arduino.app/Contents/Resources/Java/hardware/Gen7/variants/gen7/pins_arduino.h:52: error: redefinition of 'const uint8_t A2' WProgram.h:53: error: 'const uint8_t A2' previously defined here /Applications/Arduino.app/Contents/Resources/Java/hardware/Gen7/variants/gen7/pins_arduino.h:53: error: redefinition of 'const uint8_t A3' WProgram.h:54: error: 'const uint8_t A3' previously defined here /Applications/Arduino.app/Contents/Resources/Java/hardware/Gen7/variants/gen7/pins_arduino.h:54: error: redefinition of 'const uint8_t A4' WProgram.h:55: error: 'const uint8_t A4' previously defined here /Applications/Arduino.app/Contents/Resources/Java/hardware/Gen7/variants/gen7/pins_arduino.h:55: error: redefinition of 'const uint8_t A5' WProgram.h:56: error: 'const uint8_t A5' previously defined here /Applications/Arduino.app/Contents/Resources/Java/hardware/Gen7/variants/gen7/pins_arduino.h:56: error: redefinition of 'const uint8_t A6' WProgram.h:57: error: 'const uint8_t A6' previously defined here /Applications/Arduino.app/Contents/Resources/Java/hardware/Gen7/variants/gen7/pins_arduino.h:57: error: redefinition of 'const uint8_t A7' WProgram.h:58: error: 'const uint8_t A7' previously defined here In file included from Marlin.ino:154: /Applications/Arduino.app/Contents/Resources/Java/hardware/Gen7/cores/arduino/Arduino.h:207: error: default argument given for parameter 3 of 'long unsigned int pulseIn(uint8_t, uint8_t, long unsigned int)' /Applications/Arduino.app/Contents/Resources/Java/hardware/Gen7/cores/arduino/Arduino.h:116: error: after previous specification in 'long unsigned int pulseIn(uint8_t, uint8_t, long unsigned int)' /Applications/Arduino.app/Contents/Resources/Java/hardware/Gen7/cores/arduino/Arduino.h:209: error: default argument given for parameter 3 of 'void tone(uint8_t, unsigned int, long unsigned int)' WProgram.h:24: error: after previous specification in 'void tone(uint8_t, unsigned int, long unsigned int)'

@holgero
Copy link

holgero commented Apr 6, 2013

I had the same problem (WProgram.h not found) and made the following change to Marlin.h:

 #if ARDUINO >= 100
-  #if defined(__AVR_ATmega644P__) || defined (__AVR_ATmega1284P__)
-    #include "WProgram.h"
-  #else
-    #include "Arduino.h"
-  #endif
+   #include "Arduino.h"
 #else
    #include "WProgram.h"
 #endif

Afterwards compilation stopped in Marlin.ino. I tracked the missing symbols rawHotend(), minHotend() and maxHotend() back to a change in git with the commit message "Temporary workaround to fix HEATER_..." which added some 1105 command. I removed the case block and then it compiled.

But I am not sure if it is a good idea to upload the result now....

@nodje
Copy link
Author

nodje commented Apr 8, 2013

As mentioned in https://code.google.com/p/sanguino/issues/detail?id=27#c1, WProgram.h is not supposed to be necessary for Arduino version > 1.0.

So I could get Marlin compiled by including Arduino.h in any case. But why including a #if defined(__AVR_ATmega644P__) || defined (__AVR_ATmega1284P__) then? Legacy code maybe.

Anyways, even if it compiles, it compiles to 78k which is more than 644P can support.
Arduino IDE says:

Binary sketch size: 78,354 bytes (of a 63,488 byte maximum)

I'm at a loss about what to do with that. That kind of means 644P is in fact not supported.

I should turn off the LCD support, hopefully it would compile withing 64k.
Just have to figure where to turn it off, and trust it enough to upload it on the board...

epatel pushed a commit to epatel/Marlin that referenced this issue Mar 8, 2015
Various typo fixes reprappro#2 - only in comments, no code changes.
epatel pushed a commit to epatel/Marlin that referenced this issue Mar 8, 2015
epatel pushed a commit to epatel/Marlin that referenced this issue Mar 8, 2015
epatel pushed a commit to epatel/Marlin that referenced this issue Mar 12, 2015
epatel pushed a commit to epatel/Marlin that referenced this issue Mar 15, 2015
epatel pushed a commit to epatel/Marlin that referenced this issue Mar 30, 2015
epatel pushed a commit to epatel/Marlin that referenced this issue May 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants