dachev / node-cld

Language detection for Javascript (Node). Based on the CLD2 (Compact Language Detector) library from Google.
Apache License 2.0
316 stars 55 forks source link

Node v22 MSVC c++20 compilation failure #85

Open markh-discord opened 1 week ago

markh-discord commented 1 week ago

When building on Windows with Node v22.11.0 there is a compilation failure (this seems to occur both with VS2019 and VS2022):

cld\deps\cld\internal\scoreonescriptspan.h(117,16): error C7626: unnamed class used in typedef name cannot declare members other than non-static data members, member enumerations, or member classes [%ROOTPATH%\node_modules\cld\build\deps\cld\cld-c.vcxproj]
cld\deps\cld\internal\scoreonescriptspan.h(132,16): error C7626: unnamed class used in typedef name cannot declare members other than non-static data members, member enumerations, or member classes [%ROOTPATH%\node_modules\cld\build\deps\cld\cld-c.vcxproj]
cld\deps\cld\internal\scoreonescriptspan.h(186,16): error C7626: unnamed class used in typedef name cannot declare members other than non-static data members, member enumerations, or member classes [%ROOTPATH%\node_modules\cld\build\deps\cld\cld-c.vcxproj]

It seems to be caused by changes in Node 22 with the switch to -std:c++20 from -std:c++17 (https://github.com/nodejs/node/commit/b338202fab6a7d15f18918921639d16452ee964f).

Additional info:

node -v v22.11.0
node-gyp -v v10.2.0