Linker error when building OpenWrt package with multiple C files

Hi i am trying to compile a package with multiple c source files
during the linking phase, I get undefined reference to errors
I compiled a simpler version of this before that also required linked libraries and had no problems

the makefile is given below

include $(TOPDIR)/rules.mk

# Name, version and release number
# The name and version of your package are used to define the variable to point to the build directory of your package: $(PKG_BUILD_DIR)
PKG_NAME:=webfilter-ng
PKG_VERSION:=1.0
PKG_RELEASE:=1

PKG_MAINTAINER:=luigi1809
PKG_LICENSE=GPL-3.0
PKG_LICENSE_FILES=LICENSE

# Source settings (i.e. where to find the source codes)
# This is a custom variable, used below
#SOURCE_DIR:=/media/alfa/WrtTest/webfilter-ng-master
SOURCE_DIR:=/media/alfa/WrtTest/nfqueue.new/src
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
#PKG_SOURCE_URL:=https://github.com/luigi1809/webfilter-ng.git
#PKG_SOURCE_VERSION:=e7bd8ec6fae9aff0d09462e8618da37194f7f021

include $(INCLUDE_DIR)/package.mk

# Package definition; instructs on how and where our package will appear in the overall configuration menu ('make menuconfig')
define Package/webfilter-ng
  SECTION:=net
  CATEGORY:=network
  TITLE:=webfilter-ng
  DEPENDS:=+libnfnetlink +libnetfilter-queue +libjson-c +libpthread +libcurl
endef

# Package description; a more verbose description on what our package does
define Package/webfilter-ng/description
	Transparent Web Filtering for Linux.
endef

# Package preparation instructions; create the build directory and copy the source code.
# The last command is necessary to ensure our preparation instructions remain compatible with the patching system.
define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	cp -r $(SOURCE_DIR)/* $(PKG_BUILD_DIR)
	$(Build/Patch)
endef

# Package build instructions; invoke the target-specific compiler to first compile the source file, and then to link the file into the final executable
define Build/Compile
	$(TARGET_CC) -D_GNU_SOURCE $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/webfilter-ng.o -c $(PKG_BUILD_DIR)/webfilter-ng.c
	$(TARGET_CC) -D_GNU_SOURCE $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/check.o -c $(PKG_BUILD_DIR)/check.c
	$(TARGET_CC) -D_GNU_SOURCE $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/ttlnode.o -c $(PKG_BUILD_DIR)/ttlcache/src/ttlnode.c
	$(TARGET_CC) -D_GNU_SOURCE $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/ttlcache.o -c $(PKG_BUILD_DIR)/ttlcache/src/ttlcache.c
	$(TARGET_CC) -D_GNU_SOURCE $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/minheap.o -c $(PKG_BUILD_DIR)/ttlcache/src/minheap.c
	$(TARGET_CC) -D_GNU_SOURCE $(TARGET_LDFLAGS) -o $(PKG_BUILD_DIR)/$1         \
                  $(PKG_BUILD_DIR)/webfilter-ng.o $(PKG_BUILD_DIR)/check.o          \
                  $(PKG_BUILD_DIR)/ttlnode.o $(PKG_BUILD_DIR)/ttlcache.o $(PKG_BUILD_DIR)/minheap.o
endef

# Package install instructions; create a directory inside the package to hold our executable, and then copy the executable we built previously into the folder
define Package/webfilter-ng/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/webfilter-ng $(1)/usr/bin
endef

# This command is always the last, it uses the definitions and variables we give above in order to get the job done
$(eval $(call BuildPackage,webfilter-ng))

output of compiling stage

$ make package/network/utils/webfilter-ng/compile V=s

Collecting package info: done
make[1]: Entering directory '/media/alfa/WrtTest/source'
make[2]: Entering directory '/media/alfa/WrtTest/source/package/libs/toolchain'
echo "libc" >> /media/alfa/WrtTest/source/staging_dir/target-mipsel_24kc_musl/pkginfo/toolchain.default.install
echo "libgcc" >> /media/alfa/WrtTest/source/staging_dir/target-mipsel_24kc_musl/pkginfo/toolchain.default.install
echo "libpthread" >> /media/alfa/WrtTest/source/staging_dir/target-mipsel_24kc_musl/pkginfo/toolchain.default.install
make[2]: Leaving directory '/media/alfa/WrtTest/source/package/libs/toolchain'
time: package/libs/toolchain/compile#0.13#0.02#0.15
make[2]: Entering directory '/media/alfa/WrtTest/source/package/system/ca-certificates'
mkdir -p /media/alfa/WrtTest/source/dl
SHELL= flock /media/alfa/WrtTest/source/tmp/.ca-certificates_20210119.tar.xz.flock -c '  	/media/alfa/WrtTest/source/scripts/download.pl "/media/alfa/WrtTest/source/dl" "ca-certificates_20210119.tar.xz" "daa3afae563711c30a0586ddae4336e8e3974c2b627faaca404c4e0141b64665" "" "http://ftp.debian.org/debian/pool/main/c/ca-certificates"    '
echo "ca-bundle" >> /media/alfa/WrtTest/source/staging_dir/target-mipsel_24kc_musl/pkginfo/ca-certificates.default.install
make[2]: Leaving directory '/media/alfa/WrtTest/source/package/system/ca-certificates'
time: package/system/ca-certificates/compile#0.13#0.04#0.16
make[2]: Entering directory '/media/alfa/WrtTest/source/feeds/packages/libs/nghttp2'
mkdir -p /media/alfa/WrtTest/source/dl
SHELL= flock /media/alfa/WrtTest/source/tmp/.nghttp2-1.43.0.tar.xz.flock -c '  	/media/alfa/WrtTest/source/scripts/download.pl "/media/alfa/WrtTest/source/dl" "nghttp2-1.43.0.tar.xz" "f7d54fa6f8aed29f695ca44612136fa2359013547394d5dffeffca9e01a26b0f" "" "https://github.com/nghttp2/nghttp2/releases/download/v1.43.0"    '
make[2]: Leaving directory '/media/alfa/WrtTest/source/feeds/packages/libs/nghttp2'
time: package/feeds/packages/nghttp2/compile#0.16#0.03#0.18
make[2]: Entering directory '/media/alfa/WrtTest/source/package/libs/gettext'
make[2]: Leaving directory '/media/alfa/WrtTest/source/package/libs/gettext'
time: package/libs/gettext/compile#0.27#0.04#0.29
make[2]: Entering directory '/media/alfa/WrtTest/source/package/libs/libiconv'
make[2]: Leaving directory '/media/alfa/WrtTest/source/package/libs/libiconv'
time: package/libs/libiconv/compile#0.28#0.03#0.30
make[2]: Entering directory '/media/alfa/WrtTest/source/package/libs/libtool'
mkdir -p /media/alfa/WrtTest/source/dl
SHELL= flock /media/alfa/WrtTest/source/tmp/.libtool-2.4.6.tar.xz.flock -c '  	/media/alfa/WrtTest/source/scripts/download.pl "/media/alfa/WrtTest/source/dl" "libtool-2.4.6.tar.xz" "7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f" "" "@GNU/libtool"    '
make[2]: Leaving directory '/media/alfa/WrtTest/source/package/libs/libtool'
time: package/libs/libtool/compile#0.22#0.02#0.24
make[2]: Entering directory '/media/alfa/WrtTest/source/package/libs/wolfssl'
mkdir -p /media/alfa/WrtTest/source/dl
SHELL= flock /media/alfa/WrtTest/source/tmp/.wolfssl-5.2.0-stable.tar.gz.flock -c '  	/media/alfa/WrtTest/source/scripts/download.pl "/media/alfa/WrtTest/source/dl" "wolfssl-5.2.0-stable.tar.gz" "409b4646c5f54f642de0e9f3544c3b83de7238134f5b1ff93fb44527bf119d05" "" "https://github.com/wolfSSL/wolfssl/archive/v5.2.0-stable"    '
echo "libwolfssl" >> /media/alfa/WrtTest/source/staging_dir/target-mipsel_24kc_musl/pkginfo/wolfssl.default.install
make[2]: Leaving directory '/media/alfa/WrtTest/source/package/libs/wolfssl'
time: package/libs/wolfssl/compile#0.20#0.06#0.24
make[2]: Entering directory '/media/alfa/WrtTest/source/feeds/packages/net/curl'
mkdir -p /media/alfa/WrtTest/source/dl
SHELL= flock /media/alfa/WrtTest/source/tmp/.curl-7.82.0.tar.xz.flock -c '  	/media/alfa/WrtTest/source/scripts/download.pl "/media/alfa/WrtTest/source/dl" "curl-7.82.0.tar.xz" "0aaa12d7bd04b0966254f2703ce80dd5c38dbbd76af0297d3d690cdce58a583c" "" "https://dl.uxnr.de/mirror/curl/" "https://curl.askapache.com/download/" "https://curl.se/download/"    '
make[2]: Leaving directory '/media/alfa/WrtTest/source/feeds/packages/net/curl'
time: package/feeds/packages/curl/compile#0.16#0.05#0.19
make[2]: Entering directory '/media/alfa/WrtTest/source/package/libs/libmnl'
mkdir -p /media/alfa/WrtTest/source/dl
SHELL= flock /media/alfa/WrtTest/source/tmp/.libmnl-1.0.4.tar.bz2.flock -c '  	/media/alfa/WrtTest/source/scripts/download.pl "/media/alfa/WrtTest/source/dl" "libmnl-1.0.4.tar.bz2" "171f89699f286a5854b72b91d06e8f8e3683064c5901fb09d954a9ab6f551f81" "" "http://www.netfilter.org/projects/libmnl/files" "ftp://ftp.netfilter.org/pub/libmnl"    '
make[2]: Leaving directory '/media/alfa/WrtTest/source/package/libs/libmnl'
time: package/libs/libmnl/compile#0.19#0.05#0.23
make[2]: Entering directory '/media/alfa/WrtTest/source/package/libs/libnfnetlink'
mkdir -p /media/alfa/WrtTest/source/dl
SHELL= flock /media/alfa/WrtTest/source/tmp/.libnfnetlink-1.0.1.tar.bz2.flock -c '  	/media/alfa/WrtTest/source/scripts/download.pl "/media/alfa/WrtTest/source/dl" "libnfnetlink-1.0.1.tar.bz2" "f270e19de9127642d2a11589ef2ec97ef90a649a74f56cf9a96306b04817b51a" "" "http://www.netfilter.org/projects/libnfnetlink/files/" "ftp://ftp.netfilter.org/pub/libnfnetlink/"    '
make[2]: Leaving directory '/media/alfa/WrtTest/source/package/libs/libnfnetlink'
time: package/libs/libnfnetlink/compile#0.14#0.02#0.15
make[2]: Entering directory '/media/alfa/WrtTest/source/feeds/packages/libs/libnetfilter-queue'
mkdir -p /media/alfa/WrtTest/source/dl
SHELL= flock /media/alfa/WrtTest/source/tmp/.libnetfilter_queue-1.0.5.tar.bz2.flock -c '  	/media/alfa/WrtTest/source/scripts/download.pl "/media/alfa/WrtTest/source/dl" "libnetfilter_queue-1.0.5.tar.bz2" "f9ff3c11305d6e03d81405957bdc11aea18e0d315c3e3f48da53a24ba251b9f5" "" "https://www.netfilter.org/projects/libnetfilter_queue/files"    '
make[2]: Leaving directory '/media/alfa/WrtTest/source/feeds/packages/libs/libnetfilter-queue'
time: package/feeds/packages/libnetfilter-queue/compile#0.13#0.04#0.16
make[2]: Entering directory '/media/alfa/WrtTest/source/package/libs/libjson-c'
mkdir -p /media/alfa/WrtTest/source/dl
SHELL= flock /media/alfa/WrtTest/source/tmp/.json-c-0.15-nodoc.tar.gz.flock -c '  	/media/alfa/WrtTest/source/scripts/download.pl "/media/alfa/WrtTest/source/dl" "json-c-0.15-nodoc.tar.gz" "99bca4f944b8ced8ae0bbc6310d6a3528ca715e69541793a1ef51f8c5b4b0878" "" "https://s3.amazonaws.com/json-c_releases/releases/"    '
echo "libjson-c" >> /media/alfa/WrtTest/source/staging_dir/target-mipsel_24kc_musl/pkginfo/libjson-c.default.install
make[2]: Leaving directory '/media/alfa/WrtTest/source/package/libs/libjson-c'
time: package/libs/libjson-c/compile#0.15#0.04#0.18
make[2]: Entering directory '/media/alfa/WrtTest/source/package/network/utils/webfilter-ng'
touch /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/.prepared_52fd6b50233c2823a78b7bfce7ffc328_6664517399ebbbc92a37c5bb081b5c53_check
mkdir -p /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0
cp -r /media/alfa/WrtTest/nfqueue.new/src/* /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0
touch /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/.prepared_52fd6b50233c2823a78b7bfce7ffc328_6664517399ebbbc92a37c5bb081b5c53
rm -f /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/.configured_*
rm -f /media/alfa/WrtTest/source/staging_dir/target-mipsel_24kc_musl/stamp/.webfilter-ng_installed
(cd /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/./; if [ -x ./configure ]; then find /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/ -name config.guess | xargs -r chmod u+w; find /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/ -name config.guess | xargs -r -n1 cp --remove-destination /media/alfa/WrtTest/source/scripts/config.guess; find /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/ -name config.sub | xargs -r chmod u+w; find /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/ -name config.sub | xargs -r -n1 cp --remove-destination /media/alfa/WrtTest/source/scripts/config.sub; AR="mipsel-openwrt-linux-musl-gcc-ar" AS="mipsel-openwrt-linux-musl-gcc -c -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -fmacro-prefix-map=/media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0=webfilter-ng-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" LD=mipsel-openwrt-linux-musl-ld NM="mipsel-openwrt-linux-musl-gcc-nm" CC="mipsel-openwrt-linux-musl-gcc" GCC="mipsel-openwrt-linux-musl-gcc" CXX="mipsel-openwrt-linux-musl-g++" RANLIB="mipsel-openwrt-linux-musl-gcc-ranlib" STRIP=mipsel-openwrt-linux-musl-strip OBJCOPY=mipsel-openwrt-linux-musl-objcopy OBJDUMP=mipsel-openwrt-linux-musl-objdump SIZE=mipsel-openwrt-linux-musl-size CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0=webfilter-ng-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro " CXXFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0=webfilter-ng-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro " CPPFLAGS="-I/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/usr/include -I/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/include/fortify -I/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/include " LDFLAGS="-L/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/usr/lib -L/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib -znow -zrelro "   ./configure --target=mipsel-openwrt-linux --host=mipsel-openwrt-linux --build=x86_64-pc-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls  ; fi; )
touch /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/.configured_68b329da9893e34099c7d8ad5cb9c940
rm -f /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/.built
touch /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/.built_check
mipsel-openwrt-linux-musl-gcc -D_GNU_SOURCE -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0=webfilter-ng-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -o /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/webfilter-ng.o -c /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/webfilter-ng.c
mipsel-openwrt-linux-musl-gcc -D_GNU_SOURCE -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0=webfilter-ng-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -o /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/check.o -c /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/check.c
mipsel-openwrt-linux-musl-gcc -D_GNU_SOURCE -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0=webfilter-ng-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -o /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/ttlnode.o -c /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/ttlcache/src/ttlnode.c
mipsel-openwrt-linux-musl-gcc -D_GNU_SOURCE -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0=webfilter-ng-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -o /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/ttlcache.o -c /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/ttlcache/src/ttlcache.c
mipsel-openwrt-linux-musl-gcc -D_GNU_SOURCE -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0=webfilter-ng-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -o /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/minheap.o -c /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/ttlcache/src/minheap.c
mipsel-openwrt-linux-musl-gcc -D_GNU_SOURCE -L/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/usr/lib -L/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib -znow -zrelro -o /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/webfilter-ng /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/webfilter-ng.o /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/check.o /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/ttlnode.o /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/ttlcache.o /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/minheap.o
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/webfilter-ng.o: in function `category_get':
webfilter-ng.c:(.text+0x2d6): undefined reference to `curl_slist_append'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x2dc): undefined reference to `curl_easy_init'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x2e8): undefined reference to `curl_easy_setopt'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x2f4): undefined reference to `curl_easy_setopt'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x2fe): undefined reference to `curl_easy_setopt'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x30a): undefined reference to `curl_easy_setopt'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x31e): undefined reference to `curl_easy_setopt'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/webfilter-ng.o:webfilter-ng.c:(.text+0x32a): more undefined references to `curl_easy_setopt' follow
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/webfilter-ng.o: in function `category_get':
webfilter-ng.c:(.text+0x39c): undefined reference to `curl_easy_perform'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x3ae): undefined reference to `curl_easy_cleanup'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x3b4): undefined reference to `curl_slist_free_all'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x3ca): undefined reference to `json_tokener_parse'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x3d6): undefined reference to `json_object_object_get'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x3de): undefined reference to `json_object_get_int'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x3e8): undefined reference to `json_object_object_get'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x3f0): undefined reference to `json_object_get_int'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x40c): undefined reference to `json_object_put'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/webfilter-ng.o: in function `callback':
webfilter-ng.c:(.text+0x8ce): undefined reference to `nfq_get_msg_packet_hdr'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x8f6): undefined reference to `nfq_get_payload'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x910): undefined reference to `nfq_set_verdict'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/webfilter-ng.o: in function `init_libnfq':
webfilter-ng.c:(.text+0x968): undefined reference to `nfq_open'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x97a): undefined reference to `nfq_unbind_pf'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x986): undefined reference to `nfq_bind_pf'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x996): undefined reference to `nfq_create_queue'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text+0x9b4): undefined reference to `nfq_set_mode'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/webfilter-ng.o: in function `main':
webfilter-ng.c:(.text.startup+0x8a): undefined reference to `nfq_fd'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text.startup+0xae): undefined reference to `nfq_destroy_queue'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text.startup+0xb4): undefined reference to `nfq_close'
/media/alfa/WrtTest/source/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: webfilter-ng.c:(.text.startup+0xc0): undefined reference to `nfq_handle_packet'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:71: /media/alfa/WrtTest/source/build_dir/target-mipsel_24kc_musl/webfilter-ng-1.0/.built] Error 1
make[2]: Leaving directory '/media/alfa/WrtTest/source/package/network/utils/webfilter-ng'
time: package/network/utils/webfilter-ng/compile#0.94#0.11#1.03
    ERROR: package/network/utils/webfilter-ng failed to build.
make[1]: *** [package/Makefile:116: package/network/utils/webfilter-ng/compile] Error 1
make[1]: Leaving directory '/media/alfa/WrtTest/source'
make: *** [/media/alfa/WrtTest/source/include/toplevel.mk:230: package/network/utils/webfilter-ng/compile] Error 2

thanks in advance

I should link the shared objects libraries at Build/Compile stage

-lnfnetlink -lnetfilter_queue -ljson-c -lpthread -lcurl


$(TARGET_CC) -D_GNU_SOURCE $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/webfilter-ng.o -c $(PKG_BUILD_DIR)/webfilter-ng.c -lnfnetlink -lnetfilter_queue -ljson-c -lpthread -lcurl
	$(TARGET_CC) -D_GNU_SOURCE $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/check.o -c $(PKG_BUILD_DIR)/check.c -lnfnetlink -lnetfilter_queue -ljson-c -lpthread -lcurl
	$(TARGET_CC) -D_GNU_SOURCE $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/ttlnode.o -c $(PKG_BUILD_DIR)/ttlcache/src/ttlnode.c -lnfnetlink -lnetfilter_queue -ljson-c -lpthread -lcurl
	$(TARGET_CC) -D_GNU_SOURCE $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/ttlcache.o -c $(PKG_BUILD_DIR)/ttlcache/src/ttlcache.c -lnfnetlink -lnetfilter_queue -ljson-c -lpthread -lcurl
	$(TARGET_CC) -D_GNU_SOURCE $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/minheap.o -c $(PKG_BUILD_DIR)/ttlcache/src/minheap.c -lnfnetlink -lnetfilter_queue -ljson-c -lpthread -lcurl
	$(TARGET_CC) -D_GNU_SOURCE $(TARGET_LDFLAGS) -o $(PKG_BUILD_DIR)/$1         \
                  $(PKG_BUILD_DIR)/webfilter-ng.o $(PKG_BUILD_DIR)/check.o          \
                  $(PKG_BUILD_DIR)/ttlnode.o $(PKG_BUILD_DIR)/ttlcache.o $(PKG_BUILD_DIR)/minheap.o -lnfnetlink -lnetfilter_queue -ljson-c -lpthread -lcurl

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.