fdevopen was not declare in this scope

Status
Not open for further replies.

damiano

Member
Dears
I am italian and I don't speak English. Sorry!

I have:
- Teensy 3.0
- Mac OSX 10.7.5
- Arduino 1.0.5
- Teensyduino last version

When I try to compile helloword of RF24 Library selecting ArduinoMini or Arduino Uno, all ok, but if I use Teensy 3 on the screen the program write in red:

Arduino: 1.0.5 (Mac OS X), Board: "Teensy 3.0"
/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=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX128__ -fno-rtti -felide-constructors -std=gnu++0x -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/cores/teensy3 -I/Applications/Arduino.app/Contents/Resources/Java/libraries/SPI -I/Users/damianopuliti/Documents/Arduino/libraries/RF24_master /var/folders/mr/mrWxaHm0EPSvyHZ-ygDfP++++TI/-Tmp-/build7568299012048288812.tmp/GettingStarted.cpp -o /var/folders/mr/mrWxaHm0EPSvyHZ-ygDfP++++TI/-Tmp-/build7568299012048288812.tmp/GettingStarted.cpp.o
In file included from GettingStarted.pde:22:0:
printf.h: In function 'void printf_begin()':
printf.h:30: error: 'fdevopen' was not declared in this scope

It's possible help me? It's very important (for me :eek::eek:)

Thanks a lot!!!!!

Damiano
 
Damiano,
I have EXACTLY the same question as you. This also happened to me last night. Some others have gotten around this by commenting out all of the "printf" related statements, but that is a very sad solution because those "printf" statements tell you very important diagnostic information. Not sure why Teensy3 has trouble with "printf" and other related functions I found in the library like "snprintf_P" and "printf_P"...

I will be watching this thread with keen eyes. Thanks!
-frenchy
 
You can use serial port stream support

You can always switch to using the serial port monitor support to do basic print statements. I suspect most people don't use printf on embedded platforms, because it tends to drag in a lot of code that you might not need.

Code:
void setup (void)
{
    Serial.begin (9600);
}

int counter;

void loop (void)
{
    // other stuff
    Serial.print ("Counter is now: ");
    counter++;
    Serial.println (counter);
    // ...
}
 
'printf.h' is not a standard header (comes from some library you are using). 'fdevopen' is not a standard function, it's from avr-libc (which Teensy 3 doesn't use).
 
Thanks!
In others threads about RF24L01 and Teensy 3.0, authors make examples with printf. They speak about pthers problem, no printf. Why on my computer the function do mistake?
Again, if I don't use printf, must I change all instruction where call printf?

Please, excuse me for my English! I read English book and magazine very well but I don't write English.

Damiano
 
Status
Not open for further replies.
Back
Top