Unable to create DLL for C++
@AdamYoblick is already working on this.
Since Dec 12, 2023.
- Dominant language
- C#
- Stars
- 2.6k
- Forks
- 680
- Avg merge
- 39m
- Merged PRs (30d)
- 1
Description
Hi,
I'm trying to call C++ program in a pytorch project which to speed up the convolution operations.
I followed the instruction https://learn.microsoft.com/en-us/visualstudio/python/working-with-c-cpp-python-in-visual-studio?view=vs-2019 step by step.
I also updated the pip and setup tools to pip(22.3.1) and setuptools(65.7.0), I copy the full path and deleted the pyproject.toml at the end.
However, at the end of Make the DLL available to Python, when I trying to "In the search box, paste the copied path, delete pyproject.toml from the end, and then select Enter to install the module from that directory." it failed, the output is shown below.

I noticed that the fatal error C1083 cannot open include file torch/torch.h no such file or directory.
However, it can successfully build as shown below.

Can anyone help with this issue?
Update 1/15/2023
I tried to fix the setup.py and pyproject.toml as shown below, but still not working.


[Enter feedback here]
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 40e3b6b1-a3d2-f4f2-b1ad-dd654a062343
- Version Independent ID: b2418b84-04f4-60d2-ec1d-291a5d4d0c51
- Content: Write C++ extensions for Python - Visual Studio (Windows)
- Content Source: docs/python/working-with-c-cpp-python-in-visual-studio.md
- Product: visual-studio-windows
- Technology: vs-python
- GitHub Login: @cwebster-99
- Microsoft Alias: cowebster
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.