2

I know this has been asked a couple of times recently, however I'm getting a linker error when trying to compile the simplest module example on Ubuntu 13.04

Inspired by the v8 developer website, I downloaded, compiled and installed nodejs and v8 from source.

I then proceeded to attempt to compile a simple v8 example:

g++ hello_world.cc -o hello_world -Iinclude out/native/obj.target/tools/gyp/libv8_snapshot.a -lpthread

The linker errors that I am getting are:

undefined reference to `v8::HandleScope::~HandleScope()'

along with others within the v8 namespace.

Does anybody have any clue as to what library I am missing? I have the node.h and v8.h header files included in my path. Thanks in advance for your help.

2
  • you should use node-gyp to build C++ addons Commented Aug 8, 2013 at 1:48
  • Your right, I was assuming that I could compile it in eclipse with g++. Add this as an answer. Commented Aug 8, 2013 at 2:46

1 Answer 1

3

You should use node-gyp tool to build native addons.

npm install -g node-gyp

Add a binding.gyp file in addon's root directory. Check here for an example https://github.com/TooTallNate/node-gyp#the-bindinggyp-file

And then -

node-gyp configure

node-gyp build
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.