- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any additional libraries or flags that have to put in the make file or whatever else needed to make this very basic C functionality to work?
I tried both
#include "stdio.h"
#include <stdio.h>
But always got:
D:\WICED-Studio-6.2\SDK\20719-B1_Bluetooth\WICED/../apps/w191/spp1/spp.c:517: undefined reference to `sprintf'
Tracking it back to declaration in stdio.h I've got:
int _EXFUN(sprintf, (char *__restrict, const char *__restrict, ...)
_ATTRIBUTE ((__format__ (__printf__, 2, 3))));
Thanks
P.S. Same story is and with stdlib.h and malloc() and free():
D:\WICED-Studio-6.2\SDK\20719-B1_Bluetooth\WICED/../apps/w191/spp1/spp.c:520: undefined reference to `malloc'
D:\WICED-Studio-6.2\SDK\20719-B1_Bluetooth\WICED/../apps/w191/spp1/spp.c:521: undefined reference to `free'
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi StN._1917156,
The sprintf, malloc and free functions are not implemented in CYW20719B1 firmware.
However, instead of sprintf, you can use snprintf in following way:
char name[20];
int a=1;
snprintf(name, sizeof(name), "Try-%d", a);
WICED_BT_TRACE ("%s", name);
For malloc, free operations, you can use WICED APIs. Please refer wiced_memory.h for more details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi StN._1917156,
The sprintf, malloc and free functions are not implemented in CYW20719B1 firmware.
However, instead of sprintf, you can use snprintf in following way:
char name[20];
int a=1;
snprintf(name, sizeof(name), "Try-%d", a);
WICED_BT_TRACE ("%s", name);
For malloc, free operations, you can use WICED APIs. Please refer wiced_memory.h for more details.