Unable to resolve "Package testproject is missing dependencies for the following libraries:"

We are getting below error while building our sample project,

Package testproject is missing dependencies for the following libraries:
libpcap.so.1

We are building a shared library which dependent on libpcap. And our binary is using this shared library.

  1. Shared library is built using a script by exporting CC and GCC flags. And this script also builds the libpcap by the same mechanism.
  2. testproj is using openwrt Makefile build system.
    But while building testproj we are getting above error. We dont want to build the libpcap as a part openwrt build process.

Please let us know how we can fix the missing dependency missing issue.

The install scripts check for shared libs and if they are not defined as dependency, will throw this error. Whats the reason to not use the system libpcap via normal openwrt dependencies?
You can also try link your libpcap statically to avoid the error.

Thanks for the reply.
we want to use the same script to build the shared library other than openwrt build system. That's the reason we added a script to export the CC and GCC flag to build the library.
And we wanted to keep libpcap as dynamic library, since other binaries also use the libpcap on OpenWRT system,
.
We tried to copy the generated libpcap to staging_dir/host/lib file to resolve this dependency issue. But the issue did not resolve. Is there a particular path openwrt build system look for dependency pkg.?

We tried adding libpcap in EXTRA_DEPENDS in Makefile. Still, issue did not solve.
EXTRA_DEPENDS:=libpcap

Please let us how to resolve this.

There is no reason to build libpcap yourself if you want to use the system shared version anyways. You would actually break the system if you build your shared lib and than overwrite the system lib. You would need to rename or encode a private libpath to use your own shared lib, alongside the default system version.

Since i still don't get why you would do this in the first place, simply add this to your openwrt makefile and the build system will build the system libpcap for you and copy/install it correctly

For your package define add this:

define Package/mypackage
  DEPENDS:=+libpcap
endef

PS: It is also a good idea to just search/check existing openwrt package makefiles for what you want todo, aka search for libpcap or other libs in the existing package repo. This way you see some actual examples and get a idea how things work.