Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVC compiler doesn't support C++11,which cause ERROR: Failed building wheel for pyopenjtalk #66

Open
LSTM-Kirigaya opened this issue Aug 23, 2023 · 3 comments

Comments

@LSTM-Kirigaya
Copy link

LSTM-Kirigaya commented Aug 23, 2023

I meet problem when building wheels for pyopenjtalk, followings are some errors during the building of openjtalk:

here is the branch of openjtalk I use https://github.com/r9y9/open_jtalk/tree/ce06fc565eecbf57a698dacde935f2060a60d627

...
lib\open_jtalk\src\mecab/src\dictionary.cpp(68): error C2143: 语法错误: 缺少“,”(在“<”的前面)
lib\open_jtalk\src\mecab/src\dictionary.cpp(68): error C2504: “binary_function”: 未定义基类
...

It seems the problem of C++ standard of the compiler, because binary_function has been removed in C++ 14. So I attempt to modify the compiler standard, then an amusing thing took place:

image

2022 MSVC doesn't support C++11! The tool chain of MSVC was downloaded just yesterday. So I wonder how to tell the setup.py to use gcc.exe instead of cl.exe. Thx :D bro.

@LSTM-Kirigaya LSTM-Kirigaya reopened this Aug 23, 2023
@LSTM-Kirigaya LSTM-Kirigaya changed the title MSVC compiler doesn't support C++11,which MSVC compiler doesn't support C++11,which cause ERROR: Failed building wheel for pyopenjtalk Aug 23, 2023
@sabonerune
Copy link
Contributor

I'm not very familiar with C/C++, but I found some information that might be relevant.

Microsoft's C++ Standard Library - Changelog

Refactored a central internal header so that the rest of the STL includes fewer headers and provides less machinery beyond what's required. #3623 #3654
Need to include <functional> for unary_function and binary_function.
Note that unary_function and binary_function were deprecated in C++11 and removed in C++17, so it's best to stop using them completely.

@r9y9
Copy link
Owner

r9y9 commented Aug 26, 2023

According to GitHub actions https://github.com/r9y9/pyopenjtalk/actions/runs/5934952653/job/16092609013, windows CI runs with Visual Studio Enterprise 2022 (version: 17.6.33829.357).

Current runner version: '2.308.0'
Operating System
  Microsoft Windows Server [2](https://github.com/r9y9/pyopenjtalk/actions/runs/5934952653/job/16092609013#step:1:2)022
  10.0.20[3](https://github.com/r9y9/pyopenjtalk/actions/runs/5934952653/job/16092609013#step:1:3)[4](https://github.com/r9y9/pyopenjtalk/actions/runs/5934952653/job/16092609013#step:1:4)8
  Datacenter
Runner Image
  Image: windows-2022
  Version: 20230[8](https://github.com/r9y9/pyopenjtalk/actions/runs/5934952653/job/16092609013#step:1:9)04.1.0
  Included Software: https://github.com/actions/runner-images/blob/win22/20230804.1/images/win/Windows2022-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20230804.1

https://github.com/actions/runner-images/blob/win22/20230804.1/images/win/Windows2022-Readme.md

I wonder if just adding /std:c11 option to MSVC should be OK but I don't have a windows machine and cannot test.

@DogeLord081
Copy link

According to GitHub actions https://github.com/r9y9/pyopenjtalk/actions/runs/5934952653/job/16092609013, windows CI runs with Visual Studio Enterprise 2022 (version: 17.6.33829.357).

Current runner version: '2.308.0'
Operating System
  Microsoft Windows Server [2](https://github.com/r9y9/pyopenjtalk/actions/runs/5934952653/job/16092609013#step:1:2)022
  10.0.20[3](https://github.com/r9y9/pyopenjtalk/actions/runs/5934952653/job/16092609013#step:1:3)[4](https://github.com/r9y9/pyopenjtalk/actions/runs/5934952653/job/16092609013#step:1:4)8
  Datacenter
Runner Image
  Image: windows-2022
  Version: 20230[8](https://github.com/r9y9/pyopenjtalk/actions/runs/5934952653/job/16092609013#step:1:9)04.1.0
  Included Software: https://github.com/actions/runner-images/blob/win22/20230804.1/images/win/Windows2022-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20230804.1

https://github.com/actions/runner-images/blob/win22/20230804.1/images/win/Windows2022-Readme.md

I wonder if just adding /std:c11 option to MSVC should be OK but I don't have a windows machine and cannot test.

Just tested on windows, running "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\bin\Hostx86\x64\cl.exe" /std:c11 results in:

Microsoft (R) C/C++ Optimizing Compiler Version 19.37.32822 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line error D8003 : missing source filename

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants