Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Include directories (-I switch) - teensy++2.0 with USB_FLIGHTSIM (Read 8554 times)
Lefteris
Newbies
*
Offline


Posts: 3
Joined: Aug 21st, 2013
Include directories (-I switch) - teensy++2.0 with USB_FLIGHTSIM
Aug 22nd, 2013 at 5:45am
Print Post  
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: 
Code
Select All
 \
 .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:
Code
Select All
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
« Last Edit: Aug 22nd, 2013 at 5:54am by Lefteris »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Include directories (-I switch) - teensy++2.0 with USB_FLIGHTSIM
Reply #1 - Aug 22nd, 2013 at 5:28pm
Print Post  
Thanks for the note.

Actually that does sound like a minor bug and have noted it. 

By default, "project defines" do not normally cause core and libraries to re-compile unless defines that are listed in boards.txt (arduino config file) have changed. 

In the case of teensy the defines should have been detected because they exist in the the teensy boards.txt. Re-compile should have been automatic.

You rightly found that clicking "Build>Clean" clears the cache and forces the next compile to be a full compile.

It is also possible to switch on the these two project properties which will force a re-compile if any of the project defines change.

Code
Select All
Project Defines Affect Core
Project Defines Affect Libraries
 



Thanks again for the feed back

wiki created
« Last Edit: Aug 22nd, 2013 at 5:41pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint