wlav / CPyCppyy

Other
23 stars 20 forks source link

undeclared identificator ssize_t #3

Closed Marvisak closed 2 years ago

Marvisak commented 2 years ago

When building using MSVC on windows, you get an error stating that ssize_t was not defined.

Here is the whole error:

 × Building wheel for CPyCppyy (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [13 lines of output]
      running bdist_wheel
      running build
      running build_ext
      building 'libcppyy' extension
      creating build
      creating build\temp.win32-3.10
      creating build\temp.win32-3.10\Release
      creating build\temp.win32-3.10\Release\src
      "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Iinclude -IC:\Users\user\AppData\Local\Programs\Python\Python310\include -IC:\Users\user\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /Tpsrc\API.cxx /Fobuild\temp.win32-3.10\Release\src\API.obj -O2 -Zc:__cplusplus /std:c++17 /GR /EHsc- /MD
      API.cxx
      c:\users\user\appdata\local\temp\pip-install-__y5qbc_\cpycppyy_6c1c4c331ee3434685493fab1895fc7f\src\CPPInstance.h(82): error C2061: Syntax error: undeclared identificator ssize_t
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86\\cl.exe' failed with exit code 2
wlav commented 2 years ago

Thanks for reporting! Looks like a problem mainly with older MSVC? In any case, now fixed in repo by using the more portable Py_ssize_t type rather than ssize_t. Can you build from source, or should I prepare a patch release?

Marvisak commented 2 years ago

I built it from source, and it works great! The issue was probably that ssize_t is actually SSIZE_T on windows, or at least that's what I found, the ssize_t thing is just for posix systems. But thanks again!

wlav commented 2 years ago

Apparently it's also an issue with VS 2022 (https://github.com/wlav/cppyy/issues/50). I put out cppyy 2.3.1 patch release with contains just this fix over 2.3.0.

wlav commented 2 years ago

Closing this after confirmation in the other report.