Teensyduino compile error on example MIDI projects

Status
Not open for further replies.

jamesmelling

New member
Hi all,

Forgive me, as I'm very new to Arduino/Teensy.

I am looking to create a very simple 6 button USB-MIDI controller to generate program changes. I adapted one of the example programs (USB_MIDI>Buttons) to do what I wanted it to, and it would not compile. Upon reverting to the original example file and trying to compile it, it still would not compile, and gave the following error:

Code:
Arduino: 1.0.5 (Mac OS X), Board: "Teensy 3.1"
Buttons.cpp.o: In function `usb_midi_class::sendNoteOn(unsigned long, unsigned long, unsigned long)':
/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/cores/teensy3/usb_midi.h:100: undefined reference to `usb_midi_write_packed'
/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/cores/teensy3/usb_midi.h:100: undefined reference to `usb_midi_write_packed'
/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/cores/teensy3/usb_midi.h:100: undefined reference to `usb_midi_write_packed'
/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/cores/teensy3/usb_midi.h:100: undefined reference to `usb_midi_write_packed'
/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/cores/teensy3/usb_midi.h:100: undefined reference to `usb_midi_write_packed'
Buttons.cpp.o:/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/cores/teensy3/usb_midi.h:100: more undefined references to `usb_midi_write_packed' follow
Buttons.cpp.o: In function `usb_midi_class::read(unsigned char)':
/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/cores/teensy3/usb_midi.h:130: undefined reference to `usb_midi_read'
collect2: error: ld returned 1 exit status

On Arduino 1.0.5, Teensyduino 1.1.9 on Mac OS X 10.8.4, and it is configured for Teensy 3.1 and USB Type "MIDI".

Any ideas? Am I doing something REALLY stupid?!

Thanks a lot!

James
 
I can't reproduce this. Tried with 1.0.5-r2/td1.19, also with 1.0.5-r2/td1.20-rc2. No compilation errors.

When you say revert, do you mean you reloaded the original example, or do you mean you undid the changes you had made to the example?
 
Hey,

Thanks for your quick reply.

I mean that I loaded the original file again.

I would guess it's some kind of Teensyduino install issue, although I've just done a clear and re-install of the Arduino IDE and Teensyduino, to no avail.

Opening up other Teensy-specific examples and attempting to compile them yields similar results, for example trying to compile "USB_FlightSim>BlinkTransponder" gives the following error:

Code:
Arduino: 1.0.5 (Mac OS X), Board: "Teensy 3.1"
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/arm-none-eabi/bin/arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=16000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=118 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_MIDI -DLAYOUT_US_ENGLISH -I/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/cores/teensy3 /var/folders/c7/46y957v51s3dp1phgr8kfv1h0000gn/T/build8929246854868107849.tmp/BlinkTransponder.cpp -o /var/folders/c7/46y957v51s3dp1phgr8kfv1h0000gn/T/build8929246854868107849.tmp/BlinkTransponder.cpp.o 
BlinkTransponder:2: error: 'FlightSimInteger' does not name a type
BlinkTransponder.pde: In function 'void setup()':
BlinkTransponder:6: error: 'transponderLight' was not declared in this scope
BlinkTransponder:6: error: 'XPlaneRef' was not declared in this scope
BlinkTransponder.pde: In function 'void loop()':
BlinkTransponder:13: error: 'FlightSim' was not declared in this scope

So I'm at a loss, really. Picking Arduino example files at random and compiling them gives no errors, leading me to believe its a Teensyduino specific issue.

Any other input much appreciated! Will see if it happens on my work computer tomorrow.

Thanks,

James
 
Possibly you have multiple Arduino installs and the wrong one is being used? To check, in the Arduino environment go to Help > About Arduino. The splash screen will confirm the arduino and teensyduino revision numbers.
 
Status
Not open for further replies.
Back
Top