- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got:
undefined reference to `vsnprintf'
and
undefined reference to `sprintf'
Are these functions missing because I need to add some component?
e.g.:
COMPONENTS += print_func
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @BragadeeshV , with this change:
//#include <stdio.h> REMOVED
#include "sparcommon.h" ADDED
now I get a warning:
../mtb_shared/wiced_btsdk/dev-kit/baselib/20706A2/release-v3.2.0/COMPONENT_20706A2/WICED/common/spar_utils.h:55:17: warning: implicit declaration of function '__2sprintf'; did you mean 'sprintf'? [-Wimplicit-function-declaration]
but the linker error vanished.
So:
1) we don't need stdio.h
2) inside spar_utils.h we get sprintf and snprintf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @maze_1672671 ,
Support for sprintf and snprintf is present in the ROM code and you have to just include the header stdio.h and use it. vsnprintf does not have inbuilt support in the ROM code and has to be added by linking the C library. However adding support for vsnprintf would cause additional RAM usage than using snprintf. Therefore, wherever possible we highly recommend you to use snprintf over vsnprintf. Please let us know if you still want to enable support for vsnprintf.
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @BragadeeshV , with this change:
//#include <stdio.h> REMOVED
#include "sparcommon.h" ADDED
now I get a warning:
../mtb_shared/wiced_btsdk/dev-kit/baselib/20706A2/release-v3.2.0/COMPONENT_20706A2/WICED/common/spar_utils.h:55:17: warning: implicit declaration of function '__2sprintf'; did you mean 'sprintf'? [-Wimplicit-function-declaration]
but the linker error vanished.
So:
1) we don't need stdio.h
2) inside spar_utils.h we get sprintf and snprintf