user2829483
user2829483

Reputation:

debug c++ python extension from visual studio

I'm using Python Tools for Visual Studio (PTVS). I can't do the c++ debugging of an extension. I've already enabled native code debugging. My doubt is how to link the 2 projects (c++ and python)? The c++ library is loaded in this way in python (3.4 - 64bit):

cpplib = ctypes.cdll.LoadLibrary(CPPLIB_PATH)

This is what I see from Visual Studio

Upvotes: 1

Views: 1198

Answers (1)

Pavel Minaev
Pavel Minaev

Reputation: 101635

If you're just using ctypes to load a generic native (non-Python-aware) DLL, then there's no need to do anything special here. The only thing you might want to do is add a project reference from the Python project to the C++ one, so that C++ builds as a dependency when you run the Python app.

The only thing to be aware of is making sure that ctypes can find the DLL at runtime. You might want to set up the C++ project final output path to be alongside your .py files, if you want to refer to the library simply by name.

Upvotes: 1

Related Questions