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

Build StandardFirmata #117

Closed
jstitch opened this issue Sep 13, 2013 · 5 comments
Closed

Build StandardFirmata #117

jstitch opened this issue Sep 13, 2013 · 5 comments

Comments

@jstitch
Copy link

jstitch commented Sep 13, 2013

Tyring to build the StandardFirmata example (that may be found at arduino/libraries/Firmata/examples/StandardFirmata/StandardFirmata.ino )

The StandardFirmata.ino code includes the libraries Servo, Wire and Firmata, which I dutifully put on the ARDUINO_LIBS constant at the Makefile

When building with make, throws the following output:

/usr/bin/avr-g++ -x c++ -include Arduino.h -MMD -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=105 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard -I/usr/share/arduino/libraries/Servo -I/usr/share/arduino/libraries/Wire -I/usr/share/arduino/libraries/Firmata -I/usr/share/arduino/libraries/Wire/utility  -Wall -ffunction-sections -fdata-sections -Os -fno-exceptions   StandardFirmata.ino -o build-uno/StandardFirmata.o
In file included from /usr/share/arduino/libraries/Firmata/Firmata.h:16:0,
                 from StandardFirmata.ino:34:
/usr/share/arduino/libraries/Firmata/Boards.h: In function 'unsigned char writePort(byte, byte, byte)':
/usr/share/arduino/libraries/Firmata/Boards.h:355:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
StandardFirmata.ino: In function 'void setPinModeCallback(byte, int)':
StandardFirmata.ino:179:20: error: 'disableI2CPins' was not declared in this scope
     disableI2CPins();
                    ^
StandardFirmata.ino:185:68: error: 'reportAnalogCallback' was not declared in this scope
     reportAnalogCallback(PIN_TO_ANALOG(pin), mode == ANALOG ? 1 : 0); // turn on/off reporting
                                                                    ^
StandardFirmata.ino: In function 'void sysexCallback(byte, byte, byte*)':
StandardFirmata.ino:392:43: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
           if (query[i].addr = slaveAddress) {
                                           ^
StandardFirmata.ino:420:21: error: 'enableI2CPins' was not declared in this scope
       enableI2CPins();
                     ^
StandardFirmata.ino: In function 'void loop()':
StandardFirmata.ino:618:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (currentMillis - previousMillis > samplingInterval) {
                                        ^
make: *** [build-uno/StandardFirmata.o] Error 1
@sudar
Copy link
Owner

sudar commented Sep 13, 2013

Can you provide these additional details

  • Version of avr-gcc
  • Version of makefile
  • Version of Arduino

@sej7278
Copy link
Collaborator

sej7278 commented Sep 13, 2013

the "not declared in this scope" errors are due to the functions being used before they're being declared - i.e. your ino file is calling disableI2CPins() and yet that function is defined further down the file rather than at the top before setup() or loop()

this is actually bad c++ practice but the IDE preprocesses the code to let you get away with it, avr-gcc does not, its nothing to do with the makefile

can we close this issue as its NotABug and already tracked via issue #59

@jstitch
Copy link
Author

jstitch commented Sep 13, 2013

sej7278 you are right, I'll move some code around and see if that compiles fine and with no problems. In the meantime, I say yes, this is not a bug...

Thanks!

@sej7278
Copy link
Collaborator

sej7278 commented Sep 13, 2013

i've been bitten so many times by this i knew how to help you, i really wish the IDE wouldn't hand-hold like it does, as its making it harder for people to move from arduino to avr c++ programming. anyway i hope you can get it working

@sudar
Copy link
Owner

sudar commented Sep 14, 2013

Closing as duplicate of #59

@jstitch Reopen it, if you find that this is the not the reason for the error.

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

3 participants