[Libwebsockets] test-server-v2.0.c

Joel Winarske joel.winarske at gmail.com
Tue Mar 21 20:09:15 CET 2017


Is it just me, but when I build on Linux I get the below.  It's resolved
with adding #include <string.h>.

Joel

[ 63%] Building C object
CMakeFiles/test-server-v2.0.dir/test-server/test-server-v2.0.c.o
/home/joel/libwebsockets/test-server/test-server-v2.0.c: In function ‘main’:
/home/joel/libwebsockets/test-server/test-server-v2.0.c:278:2: error:
implicit declaration of function ‘memset’
[-Werror=implicit-function-declaration]
  memset(&info, 0, sizeof info);
  ^
/home/joel/libwebsockets/test-server/test-server-v2.0.c:278:2: error:
incompatible implicit declaration of built-in function ‘memset’ [-Werror]
/home/joel/libwebsockets/test-server/test-server-v2.0.c:278:2: note:
include ‘<string.h>’ or provide a declaration of ‘memset’
/home/joel/libwebsockets/test-server/test-server-v2.0.c:314:4: error:
implicit declaration of function ‘strncpy’
[-Werror=implicit-function-declaration]
    strncpy(interface_name, optarg, sizeof interface_name);
    ^
/home/joel/libwebsockets/test-server/test-server-v2.0.c:314:4: error:
incompatible implicit declaration of built-in function ‘strncpy’ [-Werror]
/home/joel/libwebsockets/test-server/test-server-v2.0.c:314:4: note:
include ‘<string.h>’ or provide a declaration of ‘strncpy’
/home/joel/libwebsockets/test-server/test-server-v2.0.c:396:7: error:
implicit declaration of function ‘strlen’
[-Werror=implicit-function-declaration]
   if (strlen(resource_path) > sizeof(cert_path) - 32) {
       ^
/home/joel/libwebsockets/test-server/test-server-v2.0.c:396:7: error:
incompatible implicit declaration of built-in function ‘strlen’ [-Werror]
/home/joel/libwebsockets/test-server/test-server-v2.0.c:396:7: note:
include ‘<string.h>’ or provide a declaration of ‘strlen’
/home/joel/libwebsockets/test-server/test-server-v2.0.c:403:7: error:
incompatible implicit declaration of built-in function ‘strlen’ [-Werror]
   if (strlen(resource_path) > sizeof(key_path) - 32) {
       ^
/home/joel/libwebsockets/test-server/test-server-v2.0.c:403:7: note:
include ‘<string.h>’ or provide a declaration of ‘strlen’
cc1: all warnings being treated as errors
CMakeFiles/test-server-v2.0.dir/build.make:62: recipe for target
'CMakeFiles/test-server-v2.0.dir/test-server/test-server-v2.0.c.o' failed
make[2]: ***
[CMakeFiles/test-server-v2.0.dir/test-server/test-server-v2.0.c.o] Error 1
CMakeFiles/Makefile2:215: recipe for target
'CMakeFiles/test-server-v2.0.dir/all' failed
make[1]: *** [CMakeFiles/test-server-v2.0.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20170321/0a3d4183/attachment.html>


More information about the Libwebsockets mailing list