相关疑难解决方法(0)

ctypes错误:libdc1394错误:无法初始化libdc1394

我正在尝试将我的程序编译成一个共享库,我可以使用ctypes在Python代码中使用它.

使用以下命令编译库:

g++ -shared -Wl,-soname,mylib -O3 -o mylib.so -fPIC [files] `pkg-config --libs --cflags opencv`
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试使用ctypes导入它时

from ctypes import *
mylib = CDLL("/path/to/mylib.so")
print mylib.test() // Expected output: Hello World
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

libdc1394 error: Failed to initialize libdc1394
Run Code Online (Sandbox Code Playgroud)

这是怎么回事?

c++ python ctypes shared-libraries libdc1394

67
推荐指数
4
解决办法
6万
查看次数

标签 统计

c++ ×1

ctypes ×1

libdc1394 ×1

python ×1

shared-libraries ×1