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

Linker error, while compiling node js from source (as a shared library) - v 6.11.2 #15195

Closed
ghost opened this issue Sep 5, 2017 · 7 comments
Labels
build Issues and PRs related to build files or the CI. embedding Issues and PRs related to embedding Node.js in another project. windows Issues and PRs related to the Windows platform.

Comments

@ghost
Copy link

ghost commented Sep 5, 2017

  • Version: 6.11.2
  • Platform: Windows
  • Subsystem: build,shared

I am trying to compile node js as a shared library from source on Windows.
Currently i am following vcbuild.bat - by passing "release" "x64" "dll" as arguments to the script.
Error (listing only one, but contains about 50+ all linker errors to v8_base_3.lib):

v8_base_3.lib(api.obj) : error LNK2005: "public: __cdecl v8::HandleScope::HandleScope(class v8::Isolate *)" (??0HandleScope@v8@@QEAA@PEAVIsolate@1@@Z) already defined in node.lib(node.dll) [D:\node-v6.11.2\cctest.vcxproj]

refack: formatted

@mscdex mscdex added build Issues and PRs related to build files or the CI. windows Issues and PRs related to the Windows platform. labels Sep 5, 2017
@ghost ghost changed the title Compilation error, while compiling node js from source (as a shared library) Linker error, while compiling node js from source (as a shared library) Sep 5, 2017
@ghost ghost changed the title Linker error, while compiling node js from source (as a shared library) Linker error, while compiling node js from source (as a shared library) - v 6.11.2 Sep 5, 2017
@ghost ghost closed this as completed Sep 5, 2017
@ghost ghost reopened this Sep 5, 2017
@Mickey248
Copy link

you reinstall and install node.js in http://nodejs.org/download in linux
and write code
$ tar -zxf node-v0.12.4.tar.gz
$ cd node-v0.12.4
$ ./configure
$ make
$ sudo make install

and success

@bzoz
Copy link
Contributor

bzoz commented Sep 6, 2017

@rao-krish sorry, I can't reproduce.

Could you provide more details? OS version, Visual Studio version, how did you obtain the code?

@refack
Copy link
Contributor

refack commented Sep 6, 2017

@rao-krish this is an annoying but a non critical error. The build process tried to build the C++ test harness cctest only after it finishes building node.dll. I think if you look in /Release/ you'll find a completed node.dll.
Anyway we currently have no harness for testing node.dll, so the following steps of vcbuild.bat are irrelevant.

This could also might happen if by any chance you are reusing previous build products (from [email protected] for example)...
Refs: #13078
Refs: #14158

@refack refack added the embedding Issues and PRs related to embedding Node.js in another project. label Sep 6, 2017
@bnoordhuis
Copy link
Member

Looks like this has been answered and OP hasn't commented since. Closing, reopen if that is a mistake.

@ghost
Copy link
Author

ghost commented Sep 11, 2017

@bzoz steps followed:
i downloaded the source from nodejs.org - for the latest LTS release
command line options: vcbuild.bat dll x64 release
OS version - Windows 10 , Visual Studio version 2015

@refack
I could see the dll and lib files generated, but since there is a linker error, i am not sure if it will work well when used in electron-atom environment, and hence i wonder if it is to do with the error when compiled.

However i am still facing this issue.

Thanks all for your inputs.

@refack
Copy link
Contributor

refack commented Sep 12, 2017

@rao-krish I'm trying to reproduce locally. Meanwhile since the error you posted is already defined I have a strong intuition that the node.dll will work.

But be aware that electron/atom float patches over "vanilla" node: electron/node@8d426bb...electron

@refack
Copy link
Contributor

refack commented Sep 12, 2017

@bzoz following the above steps reproduces
https://gist.github.com/refack/c28d94cc2ed0ee5d8408bb1aa68af35c

@rao-krish all the errors I'm seeing (~225) are multiple definition, which IMHO hints that all needed symbols are exported by node.dll

@refack refack self-assigned this Sep 18, 2017
@refack refack removed their assignment Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. embedding Issues and PRs related to embedding Node.js in another project. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

6 participants
@mscdex @refack @bnoordhuis @bzoz @Mickey248 and others