【发布时间】:2020-08-12 00:10:54
【问题描述】:
我想使用 pybind11 创建 .so ,我的代码包含这个头文件
`#include <pybind11/pybind11.h>
#include <gst/gst.h>
#include <glib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <sys/time.h>
#include "nvbufsurface.h"`
当我使用时:
c++ -O3 -Wall -shared -std=c++11 -fPIC
python3-config --cflags --ldflags-I/usr/local/lib/python3.6/dist-packages/pybind11/include -I/home/xxx/deepstream_sdk_v4 .0.2_x86_64/sources/includespkg-config --cflags gstreamer-1.0,opencv-L/home/xxx/deepstream/deepstream-4.0/lib/ -lnvbufsurface -lcudart -lnvdsgst_meta -lnvds_meta -lnvdsgst_helperpkg-config --libs gstreamer-1.0,opencvexample.cpp -o example.so
或者我使用:
c++ -O3 -Wall -shared -std=c++11 -fPIC
pkg-config --cflags gstreamer-1.0-L/home/xxx/deepstream/deepstream-4.0/lib -lnvbufsurface -lnvdsgst_meta -lnvds_meta -lnvdsgst_helper -lm -I/home /xxx/deepstream_sdk_v4.0.2_x86_64/sources/includespkg-config --libs gstreamer-1.0python3 -m pybind11 --includesexample.cpp -o examplepython3-config --extension-suffix
我在 python3 中导入示例我得到未定义的符号:NvBufSurfaceSyncForDevice 请帮帮我
【问题讨论】:
标签: python c++ python-3.x pybind11 pybinding