CESNET / libnetconf2

C NETCONF library
BSD 3-Clause "New" or "Revised" License
197 stars 144 forks source link

Building failure #484

Open pkeyela opened 2 months ago

pkeyela commented 2 months ago

Hello , I'm building the libnetcinf2 v3.0.17 library for netopeer2 but it`s failing. Could anyone help please.

CMAKE LOGS

-- The C compiler identification is GNU 13.2.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Found CMocka: /usr/lib/x86_64-linux-gnu/libcmocka.so (Required is at least version "1.0.1") -- Found Uncrustify: /usr/local/bin/uncrustify (found suitable version "0.78.1", minimum required is "0.77") -- Looking for _POSIX_TIMERS -- Looking for _POSIX_TIMERS - found -- Looking for pthread_mutex_timedlock -- Looking for pthread_mutex_timedlock - found -- Looking for pthread_mutex_clocklock -- Looking for pthread_mutex_clocklock - found -- Looking for pthread_rwlock_timedrdlock -- Looking for pthread_rwlock_timedrdlock - found -- Looking for pthread_rwlock_clockrdlock -- Looking for pthread_rwlock_clockrdlock - found -- Looking for pthread_rwlock_timedwrlock -- Looking for pthread_rwlock_timedwrlock - found -- Looking for pthread_rwlock_clockwrlock -- Looking for pthread_rwlock_clockwrlock - found -- Looking for pthread_cond_clockwait -- Looking for pthread_cond_clockwait - found -- Looking for _POSIX_MONOTONIC_CLOCK -- Looking for _POSIX_MONOTONIC_CLOCK - found -- Looking for vdprintf -- Looking for vdprintf - found -- Looking for asprintf -- Looking for asprintf - found -- Looking for vasprintf -- Looking for vasprintf - found -- Looking for getline -- Looking for getline - found -- Looking for strndup -- Looking for strndup - found -- Looking for strnstr -- Looking for strnstr - not found -- Looking for strdupa -- Looking for strdupa - found -- Looking for strchrnul -- Looking for strchrnul - found -- Looking for get_current_dir_name -- Looking for get_current_dir_name - found -- Looking for crypt.h -- Looking for crypt.h - found -- Looking for crypt_r -- Looking for crypt_r - found -- Looking for stdatomic.h -- Looking for stdatomic.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE
-- Looking for pthread_rwlockattr_setkind_np -- Looking for pthread_rwlockattr_setkind_np - found -- Looking for shadow.h -- Looking for shadow.h - found -- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found suitable version "3.0.13", minimum required is "3.0.0")
-- Found LibSSH: /usr/include (found suitable version "0.10.6", minimum required is "0.9.5") -- Found CURL: /usr/local/lib/cmake/CURL/CURLConfig.cmake (found suitable version "7.72.0-DEV", minimum required is "7.30.0")
-- Found LibPAM: /usr/lib/x86_64-linux-gnu/libpam.so
-- SSH Keyboard Interactive system method: Linux PAM -- Found LibYANG: /usr/local/lib/libyang.so (found suitable version "3.0.8", minimum required is "3.0.0") -- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1") -- Found Doxygen: /usr/bin/doxygen (found version "1.9.8") found components: doxygen dot -- Configuring done (2.4s) -- Generating done (0.1s) -- Build files have been written to: /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/build

MAKE LOGS AND ERRORS

[ 1%] Building C object CMakeFiles/netconf2.dir/src/io.c.o /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c: In function ‘nc_read_msg_io’: /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:437:9: warning: implicit declaration of function ‘ly_in_new_memory’ [-Wimplicit-function-declaration] 437 | if (ly_in_new_memory(data, msg)) { | ^~ /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c: In function ‘nc_write_msg_io’: /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:946:71: error: ‘LYD_PRINT_SHRINK’ undeclared (first use in this function) 946 | if (lyd_print_clb(nc_write_xmlclb, (void )&arg, op, LYD_XML, LYD_PRINT_SHRINK | LYD_PRINT_KEEPEMPTYCONT)) { | ^~ /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:946:71: note: each undeclared identifier is reported only once for each function it appears in /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:946:90: error: ‘LYD_PRINT_KEEPEMPTYCONT’ undeclared (first use in this function); did you mean ‘LYP_KEEPEMPTYCONT’? 946 | if (lyd_print_clb(nc_write_xmlclb, (void )&arg, op, LYD_XML, LYD_PRINT_SHRINK | LYD_PRINT_KEEPEMPTYCONT)) { | ^~~~~ | LYP_KEEPEMPTYCONT /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:974:40: error: ‘LYD_PRINT_WITHSIBLINGS’ undeclared (first use in this function); did you mean ‘LYP_WITHSIBLINGS’? 974 | LYD_PRINT_SHRINK | LYD_PRINT_WITHSIBLINGS)) { | ^~~~ | LYP_WITHSIBLINGS /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:984:13: warning: implicit declaration of function ‘lyd_new_opaq2’; did you mean ‘lyd_new_path’? [-Wimplicit-function-declaration] 984 | if (lyd_new_opaq2(NULL, session->ctx, "rpc-reply", NULL, rpc_envp->name.prefix, rpc_envp->name.module_ns, | ^~~~~ | lyd_new_path /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:984:74: error: invalid use of undefined type ‘struct lyd_node_opaq’ 984 | if (lyd_new_opaq2(NULL, session->ctx, "rpc-reply", NULL, rpc_envp->name.prefix, rpc_envp->name.module_ns, | ^~ /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:984:97: error: invalid use of undefined type ‘struct lyd_node_opaq’ 984 | if (lyd_new_opaq2(NULL, session->ctx, "rpc-reply", NULL, rpc_envp->name.prefix, rpc_envp->name.module_ns, | ^~ /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:993:69: error: invalid use of undefined type ‘struct lyd_node_opaq’ 993 | if (lyd_new_opaq2(reply_envp, NULL, "ok", NULL, rpc_envp->name.prefix, rpc_envp->name.module_ns, NULL)) { | ^~ /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:993:92: error: invalid use of undefined type ‘struct lyd_node_opaq’ 993 | if (lyd_new_opaq2(reply_envp, NULL, "ok", NULL, rpc_envp->name.prefix, rpc_envp->name.module_ns, NULL)) { | ^~ /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:994:17: warning: implicit declaration of function ‘lyd_free_tree’; did you mean ‘lyd_free_attr’? [-Wimplicit-function-declaration] 994 | lyd_free_tree(reply_envp); | ^~~~~ | lyd_free_attr /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:1005:22: error: ‘LYD_PRINT_WD_EXPLICIT’ undeclared (first use in this function); did you mean ‘LYP_WD_EXPLICIT’? 1005 | wd = LYD_PRINT_WD_EXPLICIT; | ^~~~~ | LYP_WD_EXPLICIT /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:1008:22: error: ‘LYD_PRINT_WD_TRIM’ undeclared (first use in this function); did you mean ‘LYP_WD_TRIM’? 1008 | wd = LYD_PRINT_WD_TRIM; | ^~~ | LYP_WD_TRIM /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:1011:22: error: ‘LYD_PRINT_WD_ALL’ undeclared (first use in this function); did you mean ‘LYP_WD_ALL’? 1011 | wd = LYD_PRINT_WD_ALL; | ^~ | LYP_WD_ALL /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:1014:22: error: ‘LYD_PRINT_WD_ALL_TAG’ undeclared (first use in this function); did you mean ‘LYP_WD_ALL_TAG’? 1014 | wd = LYD_PRINT_WD_ALL_TAG; | ^~~~ | LYP_WD_ALL_TAG /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:1020:13: warning: implicit declaration of function ‘LY_LIST_FOR_SAFE’; did you mean ‘LY_TREE_FOR_SAFE’? [-Wimplicit-function-declaration] 1020 | LY_LIST_FOR_SAFE(lyd_child(node), next, node) { | ^~ | LY_TREE_FOR_SAFE /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:1020:30: warning: implicit declaration of function ‘lyd_child’ [-Wimplicit-function-declaration] 1020 | LY_LIST_FOR_SAFE(lyd_child(node), next, node) { | ^~~~~ /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:1020:58: error: expected ‘;’ before ‘{’ token 1020 | LY_LIST_FOR_SAFE(lyd_child(node), next, node) { | ^~ | ; /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:1027:13: warning: implicit declaration of function ‘lyd_insert_child’; did you mean ‘lyd_insert_attr’? [-Wimplicit-function-declaration] 1027 | lyd_insert_child(reply_envp, ((struct nc_server_reply_error )reply)->err); | ^~ | lyd_insert_attr /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:1037:45: error: invalid use of undefined type ‘struct lyd_node_opaq’ 1037 | ((struct lyd_node_opaq )reply_envp)->attr = rpc_envp->attr; | ^~ /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:1037:62: error: invalid use of undefined type ‘struct lyd_node_opaq’ 1037 | ((struct lyd_node_opaq )reply_envp)->attr = rpc_envp->attr; | ^~ /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:1041:45: error: invalid use of undefined type ‘struct lyd_node_opaq’ 1041 | ((struct lyd_node_opaq )reply_envp)->attr = NULL; | ^~ /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:1050:64: error: expected ‘;’ before ‘{’ token 1050 | LY_LIST_FOR_SAFE(lyd_child(reply_envp), next, node) { | ^~ | ; /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:1058:13: warning: implicit declaration of function ‘lyd_unlink_tree’; did you mean ‘lyd_unlink’? [-Wimplicit-function-declaration] 1058 | lyd_unlink_tree(lyd_child(reply_envp)); | ^~~ | lyd_unlink /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:1020:13: warning: this statement may fall through [-Wimplicit-fallthrough=] 1020 | LY_LIST_FOR_SAFE(lyd_child(node), next, node) { | ^~~~~ /home/odu-high/repo-oduh/l2/build/netconf/test/libnetconf2/src/io.c:1025:9: note: here 1025 | case NC_RPL_ERROR: | ^~ make[2]: [CMakeFiles/netconf2.dir/build.make:76: CMakeFiles/netconf2.dir/src/io.c.o] Error 1 make[1]: [CMakeFiles/Makefile2:173: CMakeFiles/netconf2.dir/all] Error 2 make: * [Makefile:146: all] Error 2

michalvasko commented 2 months ago

Seems you have installed both libyang 3.0.8 and some really old version, probably 1.x and headers of the old version are being used. You need to clean your system and have the headers of only one libyang version installed.