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

Node v22 MSVC c++20 compilation failure #85

Open
markh-discord opened this issue Nov 15, 2024 · 3 comments
Open

Node v22 MSVC c++20 compilation failure #85

markh-discord opened this issue Nov 15, 2024 · 3 comments

Comments

@markh-discord
Copy link

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 (nodejs/node@b338202).

Additional info:

node -v v22.11.0
node-gyp -v v10.2.0
@kibertoad
Copy link

We are having the same issue.

@bengotow
Copy link

bengotow commented Jan 1, 2025

I started having this issue with the Mailspring builds as well - https://ci.appveyor.com/project/Foundry376/merani/builds/51248159. Trying to find a workaround and I'll let you know if I can find a fix!

@bengotow
Copy link

bengotow commented Jan 1, 2025

The switch to std:c++20 landed in Node 22, but it also landed in Electron this month via this patch, which explains why I'm seeing this in Electron 33 even though it still uses Node 20.

I'm building node-cld for an Electron app, and I'm generally tired of trying to get modules with native extensions to build across Mac/Windows/Linux, so I switched to using i18n.detectLanguage, which is available to Chrome extensions within their content scripts. (still using CLD, just in it's original Chromium form!) Feel free to piggy back off this commit if it'd help in your case! 👋

Foundry376/Mailspring@8751a97

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

3 participants