Skip to content

Compilation error on Linux #17

Description

@FilipLaurentiu

Any idea why I got this error ? I am not that good with C.. 😞

➜  evoplus_cid git:(master) gcc ./jni/evoplus_cid.c -o evoplus_cid                                                               git:(master|) 
./jni/evoplus_cid.c: In function ‘parse_serial’:
./jni/evoplus_cid.c:107:14: error: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration]
  107 |         if ((strlen(str) > 2) && (str[0] == '0') &&
      |              ^~~~~~
./jni/evoplus_cid.c:6:1: note: include ‘<string.h>’ or provide a declaration of ‘strlen’
    5 | #include "mmc.h"
  +++ |+#include <string.h>
    6 | 
./jni/evoplus_cid.c:107:14: warning: incompatible implicit declaration of built-in function ‘strlen’ [-Wbuiltin-declaration-mismatch]
  107 |         if ((strlen(str) > 2) && (str[0] == '0') &&
      |              ^~~~~~
./jni/evoplus_cid.c:107:14: note: include ‘<string.h>’ or provide a declaration of ‘strlen’
./jni/evoplus_cid.c:109:23: error: implicit declaration of function ‘strtol’ [-Wimplicit-function-declaration]
  109 |                 val = strtol(str, NULL, 16);
      |                       ^~~~~~
./jni/evoplus_cid.c: In function ‘main’:
./jni/evoplus_cid.c:135:15: warning: incompatible implicit declaration of built-in function ‘strlen’ [-Wbuiltin-declaration-mismatch]
  135 |         len = strlen(argv[2]);
      |               ^~~~~~
./jni/evoplus_cid.c:135:15: note: include ‘<string.h>’ or provide a declaration of ‘strlen’
./jni/evoplus_cid.c:179:9: error: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Wimplicit-function-declaration]
  179 |         close(fd);
      |         ^~~~~
      |         pclose

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions