error when use c standard function memset

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I meet a strange error, I try to use memset(), I see it can be used in 2073x, and when I use in Apps/test/test.c, it works well, but if I increase a folder, use it in Apps/test/mem/mem.c, it has a error: undefined reference to `memset', and I am certain that I both add "string.h", but one is ok, the other is error, so I want to know whether I do something in makefile like increase a path?

Thanks.

0 Likes
6 Replies
Anonymous
Not applicable

Hello Kevin,

1.  Can you send us a screen shot of the build error?

2.  Are you using SDK 2.2.1?

3.  What does your make file look like now?

Thanks

JT

0 Likes
Anonymous
Not applicable

Hello JT

1.the error log is:

../../build/hello_sensor-BCM920736TAG_Q32-rom-ram-Wiced-release/test/test.o: In function `test':

/home/kevin/WICED/Document/WICED-Smart-SDK/Wiced-Smart/spar/../../Apps/hello_sensor/test/test.c:6: undefined reference to `memset'

make[1]: *** [../../build/hello_sensor-BCM920736TAG_Q32-rom-ram-Wiced-release/A_20736A1-hello_sensor-rom-ram-spar.elf] Error 1

make: *** [hello_sensor-BCM920736TAG_Q32] Error 2

2. I use SDK 2.2.1 linux

3. the makefile is:

APP_SRC = hello_sensor.c test/test.c

INCS += $(DIR)/test

Thanks.

0 Likes
Anonymous
Not applicable

and in test.c, I only use #include "string.h"

0 Likes
Anonymous
Not applicable

Hello Kevin,

Have you tried:

#include <string.h> instead of #include "string.h"

Let me know if this works\

Thanks

JT

0 Likes
Anonymous
Not applicable

Thanks.

I try to use <string.h>, but the error still exist.

0 Likes
Anonymous
Not applicable

Can you try this?

#include "spar_utils.h"