Can Python call C++ DLL libraries compiled using extern “C” with ctypes?

0 votes
asked Sep 1 by jainsaniya (120 points)
retagged Sep 1 by Lukas Pokorny

There are many articles on the internet that say that Python cannot access C++ compiled DLLs using ctypes, and there are other contradictory articles which say that it is possible to access the DLL so long as the DLL is compiled with the extern "C" method. So I just want clarification. Is it possible if extern "C" is used?

1 Answer

0 votes
answered Sep 1 by Lukas Pokorny (113,730 points)

Yes, it is possible if extern "C" is used.

However, please note that this is Rebex forum. If you would rather like to call Rebex components or other .NET libraries from Python, consider using IronPython.