java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol “cmsg_nxthdr” referenced by “libpcap.so”

爷,独闯天下 提交于 2019-12-04 12:01:35

Move your precompiled libpcap to the JNI folder. If you are targetting multiple architectures you need to create multiple folders within your JNI corresponding to each architecture(armeabi,x86 etc) and place the .so files accordingly. Modify your manifest file like below to include your prebuilt shared library

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE    := libpcap
LOCAL_SRC_FILES := libpcap.so
include $(PREBUILT_SHARED_LIBRARY)


include $(CLEAR_VARS)
LOCAL_MODULE    := projectname
LOCAL_SRC_FILES := projectname.cpp
include $(BUILD_SHARED_LIBRARY)

projectname corresponds to the module of libpcap and projectname.cpp corresponds to the actual source file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!