microsoft / python-sample-vs-cpp-extension

This sample is the end product for the walkthrough on https://docs.microsoft.com/en-us/visualstudio/python/working-with-c-cpp-python-in-visual-studio
MIT License
76 stars 37 forks source link

C++ project properties problems #4

Open jimgunn3 opened 5 years ago

jimgunn3 commented 5 years ago

I have downloaded Python and C++ code and created VS Solution/Project as per MSFT web page instructions and Github code and instructions. The Python works perfectly. But, when I try to set the C++ properties, the "General>Target Extension: .pyd" property is not available. When build is attempted, an error message 'unresolved import supercodefast' " occurs. I checked my installation with the installer several times and have checked "Python native Development Tools" options. But when I revisit the installer, it is unchecked and appears to not have been installed. I am using VS Community 2019 with 32-bit Python and C++. This problems is probably some misunderstanding on my part, but could be a bug? Guidance to find and fix issues will be greatly appreciated. I have many needs for Python C++ extensions. Thank you.

jimgunn3 commented 5 years ago

I still can't get MSFT's Visual Studio 2019 (v16.2.0) Python (V3.74) MSVC C++ Extension walk-through (references below) to work. I have many uses for Python C++ Extensions and need to learn how to do this. I am requesting help to directly compile using the C++ compiler and/or Python distutils module (setup.py). Hopefully this will provide guidance and knowledge to VS working. Thank you.

URLs to this walk-through are: 1) https://github.com/MicrosoftDocs/visualstudio-docs/blob/master/docs/python/working-with-c-cpp-python-in-visual-studio.md, and 2) https://github.com/microsoft/python-sample-vs-cpp-extension. I am using the Python and C++ compiler installed via VS. I used the code as is from GitHub URL 2) above: 1) CPPandPython, 2) superfastcode, and 3) superfastcode2 The Python Code (with C++ calls commented out) works exactly as expected. I been able to get the CPython superfastcode to work manually using setup.py, but not in VS. I am unable to get the pybind11 code to work either manually or in VS. I think I followed the steps in the walk-through carefully, but limited success so far. This is a mixed mode VS Solution with 3 projects. This walk-through requires significant VS configurations for Python project paths, extensions, etc.; and C++ project(s) property configurations as per the above URLs. I think my problems must be mis-understanding(s) of the mixed mode configurations, but what???? Guidance will be appreciated.

jimgunn3 commented 5 years ago

I was not aware this issue was closed. Sorry.

Anapo14 commented 5 years ago

Maybe @zooba could potentially provide some guidance on the best practice here?