ImportError: [库名称].so: 未定义符号: [函数名称]

发布于 2024-09-08 12:39:34 字数 532 浏览 4 评论 0原文

我正在使用 C 模块扩展我的 Python 程序,该模块使用 GStreamer 的 GstPhotography 接口。我的 C 模块编译得很好,但是当我尝试从 Python 运行它时,我收到此错误:

$python Program.py
Traceback (most recent call last):
   File "Program.py", line 10, in <module>
     import MyPythonClass
   File "/path/MyPythonClass.py", line 19, in <module>
     import my_c_module
ImportError: /path/my_c_module.so: undefined symbol: gst_photography_get_type  

我不太确定这意味着什么,因为我从未在 my_c_module.cpp 中使用 gst_photography_get_type - 这是在 GstPhotography 源代码中实现的函数。

I'm extending my Python program with a C module that uses the GstPhotography interface for GStreamer. My C module compiles fine, but when I try running it from Python, I get this error:

$python Program.py
Traceback (most recent call last):
   File "Program.py", line 10, in <module>
     import MyPythonClass
   File "/path/MyPythonClass.py", line 19, in <module>
     import my_c_module
ImportError: /path/my_c_module.so: undefined symbol: gst_photography_get_type  

I'm not really sure what this means, because I never use gst_photography_get_type in my_c_module.cpp--it's a function implemented in the GstPhotography source code.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦途 2024-09-15 12:39:34

这意味着您没有链接足够的库,要么是因为 pkgconfig 文件中没有指出,要么是您一开始就没有引用 pkgconfig 文件。

It means that you didn't link against enough libraries, either because it wasn't indicated in the pkgconfig file, or you didn't refer to the pkgconfig file in the first place.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文