I am using pybind11 setuptools to build a python module(.pyd),but an error occurred when it comes to
executing :error: command ‘C:Program FilesMicrosoft Visual Studio2022CommunityVCToolsMSVC14.39.33519binHostX86x64cl.exe’ failed with exit code 2
setup.py:
import os
from setuptools import setup,find_packages
from pybind11.setup_helpers import Pybind11Extension, build_ext
cpp_source_dir = os.path.join(os.path.dirname(os.path.abspath(file)),
“cpp_source”)
serial_handler_path = os.path.join(cpp_source_dir, “serial_handler.cpp”)
ext_modules = [
Pybind11Extension(
name=”serial_handler”,
sources=[serial_handler_path],
)
]
setup(cmdclass={“build_ext”: build_ext}, ext_modules=ext_modules,packages=find_packages())
but it worked successfully on visual studio IDE when i use IDE button to build the .pyd file .
vs configures:enter image description here[enter image description here](https://i.sstatic.net/lGCCVOC9.jpg)
i want to generate .pyd module by python pybind11 setuptools.