Shop OBEX P1 Docs P2 Docs Learn Events
[RESOLVED] fwrite() causes compile error in SimpleIDE — Parallax Forums

[RESOLVED] fwrite() causes compile error in SimpleIDE

WossnameWossname Posts: 174
edited 2012-11-12 07:17 in Propeller 1
Started using SimpleIDE for the first time - I have a noobie question...

[PHP]
#include <stdio.h>
#include <propeller.h>
int main(void)
{
while(1)
{
waitcnt(CLKFREQ + CNT);
printf("Hello\n");
fwrite("World\n", 1, 6, stdout);
}
return 0;
}
[/PHP]

Hitting the Build button yields this result...
Project Directory: C:/code/SimpleIDE/hello/
Ignoring "Simple printf" flag in COG mode program.
propeller-elf-gcc.exe -o a.out -Os -mcog -I . -fno-exceptions hello.c
C:\Users\ADAM~1.WAR\AppData\Local\Temp\cceK5yau.o: In function `.L2':
(.text+0x54): undefined reference to `_fwrite'
C:\Users\ADAM~1.WAR\AppData\Local\Temp\cceK5yau.o: In function `.LC5':
(.text+0x68): undefined reference to `_(float, int, long,...)(short)'
collect2: ld returned 1 exit status
Done. Build Failed!
Check source for bad function call or global variable name `_fwrite'
C:\Users\ADAM~1.WAR\AppData\Local\Temp\cceK5yau.o: In function `.LC5':
(.text+0x68):
I want to be able to write arbitrary binary data down the serial port using fwrite() but for some reason it refuses allow this usage.

Is there some magical incantation or some config thing I've missed out somewhere?







EDIT:
Yes, apparently I should have used the "LMM" setting apparently.

SOLVED!
Sign In or Register to comment.