Edited: PLEASE IGNORE: Performing a Solution Clean and then recompile has solved the issue
Hello,
I have managed to successfully build and run (have not tried debugging yet but this will be next) some teensy++2.0 code. VM is great and the support on the forum excellent.
My problem now is the following:
I am trying to build a trivial program (that builds successfully with Arduino IDE) using the USB_FLIGHTSIM define instead of the USB_SERIAL. However, the build fails with the errors shown below and I think that the reason is that the directory
C:\Program Files (x86)\Arduino\hardware\teensy\cores\usb_flightsim is not used and instead
C:\Program Files (x86)\Arduino\hardware\teensy\cores\usb_serial is used. I figured this out by looking at
usb_api.cpp.d which is the following:
\
.o: \
C:\Program\ Files\ (x86)\Arduino\hardware\teensy\cores\teensy\usb_api.cpp \
C:\Program\ Files\ (x86)\Arduino\hardware\teensy\cores\teensy\/../usb_serial/usb_api.cpp \
C:\Program\ Files\ (x86)\Arduino\hardware\teensy\cores\teensy/usb_common.h \
C:\Program\ Files\ (x86)\Arduino\hardware\teensy\cores\teensy\/../usb_serial/usb_private.h \
C:\Program\ Files\ (x86)\Arduino\hardware\teensy\cores\teensy\/../usb_serial/usb_api.h \
C:\Program\ Files\ (x86)\Arduino\hardware\teensy\cores\teensy/Stream.h \
C:\Program\ Files\ (x86)\Arduino\hardware\teensy\cores\teensy/Print.h \
C:\Program\ Files\ (x86)\Arduino\hardware\teensy\cores\teensy/core_id.h \
C:\Program\ Files\ (x86)\Arduino\hardware\teensy\cores\teensy/../usb_serial/core_id.h \
C:\Program\ Files\ (x86)\Arduino\hardware\teensy\cores\teensy/WString.h \
C:\Program\ Files\ (x86)\Arduino\hardware\teensy\cores\teensy/Printable.h \
C:\Program\ Files\ (x86)\Arduino\hardware\teensy\cores\teensy/new.h \
C:\Program\ Files\ (x86)\Arduino\hardware\teensy\cores\teensy/wiring.h \
C:\Program\ Files\ (x86)\Arduino\hardware\teensy\cores\teensy/binary.h \
C:\Program\ Files\ (x86)\Arduino\hardware\teensy\cores\teensy/core_pins.h
The error that I get is during link I believe and is shown below:
Compiling 'test' for 'Teensy++ 2.0'
test.cpp.o : : In function `__static_initialization_and_destruction_0':
test.ino : FlightSimInteger()'
test.cpp.o : : In function `loop':
test.ino : update()'
test.cpp.o : : In function `FlightSimInteger::assign(_XpRefStr_ const*)':
usb_api.h : enabled'
usb_api.h : identify()'
Error creating .elf My trivial code is the following:
FlightSimInteger bat1;
void setup()
{
/* add setup code here */
bat1 = XPlaneRef("sim/custom/xap/elec/bat1_on");
bat1.onChange(updateLed);
pinMode(LED_BUILTIN,OUTPUT);
}
void loop()
{
/* add main program code here */
FlightSim.update();
}
void updateLed(long val)
{
if(val == 0) digitalWrite(LED_BUILTIN, LOW); else digitalWrite(LED_BUILTIN,HIGH);
}
Edited: One more thing: Changing the project property "Source Defines Affect Libraries" for some reason gives me no output in the output window but also no executable.
Please note that I am using vm version 1308.18
Thank you in advance,
Lefteris