-
Notifications
You must be signed in to change notification settings - Fork 30k
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
v14.6.0 dll build error #34539
Comments
That function lives in winmm.lib and that library is linked in, as far as I'm aware. Long shot but does this patch help? diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp
index f8259069c9..7a51ec9b54 100644
--- a/tools/v8_gypfiles/v8.gyp
+++ b/tools/v8_gypfiles/v8.gyp
@@ -1093,6 +1093,15 @@
'defines': ['_WIN32_WINNT=0x0602'], # For GetCurrentThreadStackLimits on Windows on Arm
}]],
'defines': ['_CRT_RAND_S'], # for rand_s()
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'AdditionalDependencies': [
+ 'dbghelp.lib',
+ 'winmm.lib',
+ 'ws2_32.lib'
+ ]
+ }
+ },
'direct_dependent_settings': {
'msvs_settings': {
'VCLinkerTool': { |
I applied your diff but unfortunately the problem still remains the same. |
I'm fairly sure other people build the DLL without problems (it might even be tested by our CI, I'm not sure) so it's probably an issue local to your system. I don't have concrete suggestions on how to fix it. You'll probably have to go over the *.gyp and *.gypi files and judiciously add/update link sections. There are quite a few build files but node.gyp/node.gypi and the V8 *.gyp files are the most relevant ones. |
I believe too there are people that build the dll. So I did a fresh install of Windows 10 and installed only git, Python 3.8, Visual Studio Community 2019 with the C++ workload and downloaded Node.js 14.6.0 from the release tab on Github. But it resulted in the same error. |
Can reproduce. Also - I can't find a revision that would build the dll successfully, so it looks this is broken for some time now. /cc @nodejs/platform-windows @nodejs/build-files |
Using this patch: diff --git a/node.gyp b/node.gyp
index 6dd9541cc5..302e9ba269 100644
--- a/node.gyp
+++ b/node.gyp
@@ -823,6 +823,7 @@
'Dbghelp',
'Psapi',
'Ws2_32',
+ 'Winmm'
],
}],
[ 'node_use_etw=="true"', { will fix this linking error, but it will open another can of worms:
the |
Oh, and manually removing |
I had to do the following once I found this issue:
Thanks @bzoz for the help! |
@Reveares @bzoz @seesemichaelj |
@jianweiqin Unfortunately, I don't currently have the time to pull out the proprietary pieces of the code I've gotten working for a publicly distributable example. I'm guessing I won't have the time any time soon. I can however maybe give you a couple of quick function references for initialization:
std::vector<std::string> args = { "SomeArbitaryStringIGuess" };
std::vector<std::string> exec_args;
std::vector<std::string> errors;
if (!node::NodeIsInitialized()) {
exit_code = node::InitializeNodeWithArgs(&args, &exec_args, &errors);
...
this->platform = node::CreatePlatform(4, (v8::TracingController *) nullptr);
v8::V8::InitializePlatform(this->platform);
v8::V8::Initialize();
} else {
this->platform = (node::MultiIsolatePlatform*) v8::V8::GetCurrentPlatform();
}
There's a lot of minor details missing from this, but this should give you some indicator of source files to dig through and determine the solution on your own. Best of luck! |
Still happening in
|
https://www.electronjs.org/blog/electron-internals-node-integration |
Alternatively:
Note: It seems to work for Visual Studio 2019 toolchain but not for 2022) |
Any chance the build system could be fixed upstream for Windows? EDIT: I actually think it's fixed and non of that is needed anymore |
I'm indeed fairly sure it's fixed (also in v14.x) and that we simply forgot to close this issue so I'll go ahead and do that now. |
What steps will reproduce the bug?
Build Node 14.6.0 as 64-bit and shared linkage under windows. Meanwhile static linkage works fine for me.
.\vcbuild.bat dll
Results in:
The text was updated successfully, but these errors were encountered: