printf_P missing

I am new to the Arduino family and am finding a few things frustrating and not finding the answers online.
The first thing that I am struggling with is the fact that many samples I find online use printf_P, however, my Arduino IDE does not seem to have that method attached to my stdio.h library.

I am certain this is a very simple issue to resolve (which may be why I can find no help online, because only a complete idiot would need it), but I am a complete idiot and need some guidance.

TIA for anyone who is nice enough to hold my hand through this and not just point out what an idiot I am (as I have already fully admitted to being such)

CODE

#include <stdio.h>
void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:
  printf_P("test");
}

ERROR
Arduino: 1.5.8 (Windows 8), Board: "LinkIt ONE"

C:\Program Files (x86)\Arduino/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-g++ -c -g -O2 -fvisibility=hidden -fpic -mthumb -mlittle-endian -nostdlib -fno-non-call-exceptions -fno-rtti -fno-exceptions -Dprintf=iprintf -mcpu=arm7tdmi-s -DF_CPU=84000000L -DARDUINO=158 -DARDUINO_MTK_ONE -DARDUINO_ARCH_MTK -D__COMPILER_GCC__ -D__LINKIT_ONE__ -D__LINKIT_ONE_RELEASE__ -mthumb -DUSB_VID=0x0E8D -DUSB_PID=0x0023 -DUSBCON -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="LinkIt ONE" -IC:\Program Files (x86)\Arduino\hardware\arduino\mtk\system/libmtk -IC:\Program Files (x86)\Arduino\hardware\arduino\mtk\system/libmtk/include -IC:\Program Files (x86)\Arduino\hardware\arduino\mtk\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\mtk\variants\linkit_one C:\Users\Mark\AppData\Local\Temp\build4523594289827322327.tmp\sketch_jan16a.cpp -o C:\Users\Mark\AppData\Local\Temp\build4523594289827322327.tmp\sketch_jan16a.cpp.o

sketch_jan16a.ino: In function 'void loop()':
sketch_jan16a.ino:9:18: error: 'printf_P' was not declared in this scope
Error compiling.

Mark

Where, exactly, were you expecting the output of print_P to appear?
And at what line speed?

printf() is not available in the Arduino IDE.

You can instead use sprintf() and its variants to form a character array (string), and print that string with the standard Arduino Serial.print.

AWOL:
Where, exactly, were you expecting the output of print_P to appear?
And at what line speed?

I wasn't expecting it to work like the Serial debug. This function "printf_P" appears in a library I am attempting to understand/use. They call printf_P but my compiler does not know the function. I thought maybe, since others online have used this library (and did not mention having to modify it, nor mention anything about having issues with printf_P), that it was something wrong with my system.

I thought maybe, since others online have used this library (and did not mention having to modify it, nor mention anything about having issues with printf_P), that it was something wrong with my system.

What library? Who used it without problems?

"Standard IO" (stdio.h) is used in Unix systems because Unix programs have a notion of "standard input" (usually the keyboard) and "standard output" (usually your terminal). As you know, the Arduino does not have a keyboard or terminal, thus standard input and standard output are meaningless.

The Arduino does not support "stdio" instead you have hardwareSerial. The IDE deals with the include etc for you. You just use Serial.print() etc. Look in the reference section. stdio is the old i/o lib from the days of C. Streams is its C++ replacement. hardwareSerial is based on streams.

Make sure that any code examples you look at are for the Arduino.

stdio also supports files which the Arduino does not have a such.

Mark

int myPutc( char c, FILE *t) 
{
  Serial.write( c );
}


void setup()
{
  Serial.begin(115200);
  fdevopen( &myPutc, 0);
}

void loop()
{
  printf_P("Hello World!\n");

}

Any help?

I wasn't expecting it to work like the Serial debug.

?

Ok, thanks everyone. I thought printf_P was something in the Arduino implementation of stdio or another library. It makes total sense to not have printf, no console to print to.

I modified the library to use the Serial.print instead (since the calls to printf_P were for debugging purposes).

I have it compiling now.

Thanks again for the quick response. Arduino community seems impressive.

Mark