简体   繁体   中英

Python ctypes.CDLL loads my shared library successfully, but I can't see any of my C++ functions

Building a shared (.so) library with nvcc for a small C++ project. When I load this library in python with ctypes.CDLL(), the operation seems to succeed. But when I look at the resulting object with dir(libc), all I see are built-in methods, not any of my C++ functions from the library.

What am I doing wrong?

好的...我需要在我的 .h 文件中的函数声明之前有 extern "C"。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM