pybind / pybind/python_example

Building with MinGW

Open
#58 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
530
Forks
150
Avg merge
8d 2h
Merged PRs (30d)
1

Description

I tried to run setup.py with MinGW instead of Visual Studio MSVC
python setup.py build --compiler=mingw32

I get the following error:
ValueError: Unknown MS Compiler version 1916

Is there any way to make it work with MinGW?

Note that a manual compilation with MinGW works perfectly running:

g++ -static -shared -std=c++11 -DMS_WIN64 -fPIC -I C:\...\Python\Python38\Lib\site-packages\pybind11\include -I C:\ ... \Python\Python38\include -L C:\ ... \Python\Python38\libs src\main.cpp -o python_example.pyd -lPython38

but I cannot manage to make it to work with setuptools.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with setup.py and reproduce the reported command, python setup.py build --compiler=mingw32, on Windows with MinGW. Trace the handling of the Unknown MS Compiler version 1916 error and compare it with the manual compilation command shown. Done means the example builds successfully through setuptools with MinGW.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.