How to include stdio.h for printf?

New to XMOS and XCore? Get started here.
Post Reply
MosMax
New User
Posts: 3
Joined: Wed May 23, 2012 12:44 am

How to include stdio.h for printf?

Post by MosMax »

This should be an easy question to answer. I am extremely new to this. I tried compiling this code for the XC-1, but the compiler had the error can't open include file "stdio.h".

Thanks!

Code: Select all

# include < stdio .h >

main ( void ) {
   printf ( " Hello , world !\ n " );
}
Fixed it!. The problem was the spaces. It should be

Code: Select all

#include <stdio.h>
main ( void ) {
printf ("Hello , world !\n");
}


User avatar
phalt
Respected Member
Posts: 298
Joined: Thu May 12, 2011 11:14 am
Contact:

Post by phalt »

For a lot of these types of questions, especially common ones related to C, you can google the answers or check on stackoverflow
User avatar
rp181
Respected Member
Posts: 395
Joined: Tue May 18, 2010 12:25 am
Contact:

Post by rp181 »

Also, it should be noted almost all examples in the pdf documentation will not copy-paste correctly. It's easier to re-type the examples.
Post Reply