Hi, Alan, I use ./tool/configure.sh arduino-m0/nsh Thanks to your blog, I am porting an arduino project to Nuttx
Xiang Xiao, Indeed DEFAULT_SMALL was activated. it works with CONFIG_FILE_STREAM enabled. How did you know? Thank you for your support. Bert. Le mar. 29 août 2023 à 04:20, Xiang Xiao <xiaoxiang781...@gmail.com> a écrit : > Do you enable DEFAULT_SMALL? If so, you have to enable CONFIG_FILE_STREAM > in defconfig explicitly. > > On Tue, Aug 29, 2023 at 6:11 AM Bert Voldenuit <bertvolden...@gmail.com> > wrote: > > > Hello, > > > > I am trying to run the serialrx app (out of the box) from the examples, > but > > i get the following errors: > > > > - Some warnings because of conversion; no big deal > > - undefined reference to standard librarie function like: fprintf, > > lib_get_stream, fflush; I think this is the main problem but why? > > > > bert@DESKTOP-UO6EU0I:/mnt/d/BertDocs/nuttxspace12/nuttx$ make > > Create version.h > > LN: platform/board to /mnt/d/BertDocs/nuttxspace12/apps/platform/dummy > > Register: custom_hello > > Register: serialrx > > Register: nsh > > Register: sh > > CC: serialrx_main.c serialrx_main.c: In function 'serialrx_main': > > serialrx_main.c:83:15: warning: passing argument 1 of 'fprintf' makes > > pointer from integer without a cast [-Wint-conversion] > > 83 | fprintf(stderr, "Usage: %s [devpath]\n", argv[0]); > > | ^~~~~~ > > | | > > | int > > In file included from serialrx_main.c:31: > > /mnt/d/BertDocs/nuttxspace12/nuttx/include/stdio.h:147:26: note: expected > > 'FILE *' {aka 'struct file_struct *'} but argument is of type 'int' > > 147 | int fprintf(FAR FILE *stream, FAR const IPTR char *format, > ...) > > | ~~~~~~^~~~~~ > > serialrx_main.c:95:15: warning: passing argument 1 of 'fprintf' makes > > pointer from integer without a cast [-Wint-conversion] > > 95 | fprintf(stderr, "ERROR: malloc failed: %d\n", errno); > > | ^~~~~~ > > | | > > | int > > In file included from serialrx_main.c:31: > > /mnt/d/BertDocs/nuttxspace12/nuttx/include/stdio.h:147:26: note: expected > > 'FILE *' {aka 'struct file_struct *'} but argument is of type 'int' > > 147 | int fprintf(FAR FILE *stream, FAR const IPTR char *format, > ...) > > | ~~~~~~^~~~~~ > > serialrx_main.c:110:15: warning: passing argument 1 of 'fprintf' makes > > pointer from integer without a cast [-Wint-conversion] > > 110 | fprintf(stderr, "ERROR: open failed: %d\n", errno); > > | ^~~~~~ > > | | > > | int > > In file included from serialrx_main.c:31: > > /mnt/d/BertDocs/nuttxspace12/nuttx/include/stdio.h:147:26: note: expected > > 'FILE *' {aka 'struct file_struct *'} but argument is of type 'int' > > 147 | int fprintf(FAR FILE *stream, FAR const IPTR char *format, > ...) > > | ~~~~~~^~~~~~ > > serialrx_main.c:116:10: warning: passing argument 1 of 'fflush' makes > > pointer from integer without a cast [-Wint-conversion] > > 116 | fflush(stdout); > > | ^~~~~~ > > | | > > | int > > In file included from serialrx_main.c:31: > > /mnt/d/BertDocs/nuttxspace12/nuttx/include/stdio.h:139:25: note: expected > > 'FILE *' {aka 'struct file_struct *'} but argument is of type 'int' > > 139 | int fflush(FAR FILE *stream); > > | ~~~~~~^~~~~~ > > serialrx_main.c:143:18: warning: passing argument 1 of 'fflush' makes > > pointer from integer without a cast [-Wint-conversion] > > 143 | fflush(stdout); > > | ^~~~~~ > > | | > > | int > > In file included from serialrx_main.c:31: > > /mnt/d/BertDocs/nuttxspace12/nuttx/include/stdio.h:139:25: note: expected > > 'FILE *' {aka 'struct file_struct *'} but argument is of type 'int' > > 139 | int fflush(FAR FILE *stream); > > | ~~~~~~^~~~~~ > > serialrx_main.c:153:22: warning: passing argument 1 of 'fflush' makes > > pointer from integer without a cast [-Wint-conversion] > > 153 | fflush(stdout); > > | ^~~~~~ > > | | > > | int > > In file included from serialrx_main.c:31: > > /mnt/d/BertDocs/nuttxspace12/nuttx/include/stdio.h:139:25: note: expected > > 'FILE *' {aka 'struct file_struct *'} but argument is of type 'int' > > 139 | int fflush(FAR FILE *stream); > > | ~~~~~~^~~~~~ > > serialrx_main.c:182:10: warning: passing argument 1 of 'fflush' makes > > pointer from integer without a cast [-Wint-conversion] > > 182 | fflush(stdout); > > | ^~~~~~ > > | | > > | int > > In file included from serialrx_main.c:31: > > /mnt/d/BertDocs/nuttxspace12/nuttx/include/stdio.h:139:25: note: expected > > 'FILE *' {aka 'struct file_struct *'} but argument is of type 'int' > > 139 | int fflush(FAR FILE *stream); > > | ~~~~~~^~~~~~ > > serialrx_main.c:198:10: warning: passing argument 1 of 'fflush' makes > > pointer from integer without a cast [-Wint-conversion] > > 198 | fflush(stderr); > > | ^~~~~~ > > | | > > | int > > In file included from serialrx_main.c:31: > > /mnt/d/BertDocs/nuttxspace12/nuttx/include/stdio.h:139:25: note: expected > > 'FILE *' {aka 'struct file_struct *'} but argument is of type 'int' > > 139 | int fflush(FAR FILE *stream); > > | ~~~~~~^~~~~~ > > LD: nuttx > > arm-none-eabi-ld: > > > > > /mnt/d/BertDocs/nuttxspace12/nuttx/staging/libapps.a(serialrx_main.c.mnt.d.BertDocs.nuttxspace12.apps.examples.serialrx.o): > > in function `serialrx_main': > > serialrx_main.c:(.text.serialrx_main+0x34): undefined reference to > > `lib_get_stream' > > arm-none-eabi-ld: serialrx_main.c:(.text.serialrx_main+0x48): undefined > > reference to `lib_get_stream' > > arm-none-eabi-ld: serialrx_main.c:(.text.serialrx_main+0x50): undefined > > reference to `fprintf' > > arm-none-eabi-ld: serialrx_main.c:(.text.serialrx_main+0x56): undefined > > reference to `lib_get_stream' > > arm-none-eabi-ld: serialrx_main.c:(.text.serialrx_main+0x5a): undefined > > reference to `fflush' > > arm-none-eabi-ld: serialrx_main.c:(.text.serialrx_main+0x74): undefined > > reference to `lib_get_stream' > > arm-none-eabi-ld: serialrx_main.c:(.text.serialrx_main+0x84): undefined > > reference to `fprintf' > > arm-none-eabi-ld: serialrx_main.c:(.text.serialrx_main+0x9c): undefined > > reference to `lib_get_stream' > > arm-none-eabi-ld: serialrx_main.c:(.text.serialrx_main+0xa0): undefined > > reference to `fflush' > > arm-none-eabi-ld: serialrx_main.c:(.text.serialrx_main+0xc2): undefined > > reference to `lib_get_stream' > > arm-none-eabi-ld: serialrx_main.c:(.text.serialrx_main+0xc6): undefined > > reference to `fflush' > > arm-none-eabi-ld: serialrx_main.c:(.text.serialrx_main+0x10c): undefined > > reference to `lib_get_stream' > > arm-none-eabi-ld: serialrx_main.c:(.text.serialrx_main+0x110): undefined > > reference to `fflush' > > arm-none-eabi-ld: serialrx_main.c:(.text.serialrx_main+0x12a): undefined > > reference to `lib_get_stream' > > arm-none-eabi-ld: serialrx_main.c:(.text.serialrx_main+0x12e): undefined > > reference to `fflush' > > make[1]: *** [Makefile:197: nuttx] Error 1 > > make: *** [tools/Unix.mk:537: nuttx] Error 2 > > > > Regards, > > Bertrand. > > >