This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

strpos() not working when strstr() works

Dear Board

I’m using STM32F103 controller, when I use strstr function for finding a word in a string the compiler throws a warning. No issue for me but the code works fine

But when I use strops(), the compiler throws error. It says this is used for C199 etc.. where can I see the string functions supported for MDK-IDE??

Below is the code im trying to execute for which IDE throws error


This code is extracted from keil reference book and applied for MDK according to my usage

#include <string.h>
#include <stdio.h> /* for printf */

void tst_strcat (void) {

  unsigned char buf [21];
  unsigned char s [] = "Test String";

  strcpy (buf, s);
  strcat (buf, " #2");

  printf ("new string is %s\n", buf);
}

Parents
  • Yes.. i thought it.. but i felt like it is common problem that someone could already came across.

    here is what im receiving
    during coding : Warning : implicet declaration of function 'strpos' is invalid in C99

    after compiling the error is
    UART\UART.axf: Error: L6218E: Undefined symbol strpos (referred from main.o).
    Not enough information to list image symbols.
    Finished: 1 information, 0 warning and 1 error messages.
    "UART\UART.axf" - 1 Error(s), 4 Warning(s).

Reply
  • Yes.. i thought it.. but i felt like it is common problem that someone could already came across.

    here is what im receiving
    during coding : Warning : implicet declaration of function 'strpos' is invalid in C99

    after compiling the error is
    UART\UART.axf: Error: L6218E: Undefined symbol strpos (referred from main.o).
    Not enough information to list image symbols.
    Finished: 1 information, 0 warning and 1 error messages.
    "UART\UART.axf" - 1 Error(s), 4 Warning(s).

Children