4

How do I include Google's V8 Javascript Engine in a QTCreator Console Project?

I have already compiled V8 and I have played around with the example shell and d8 developer shell. I'd like to start writing code to use this library in QTCreator.

I'm new to QTCreator and my issue is trying to set up the .pro file so that QTCreator compiles it correctly. For now, I just want the hello world example to work.

The hello world example from Google's V8: http://code.google.com/apis/v8/get_started.html

Any help is appreciated.

TheAutumnAurora
  • 123
  • 1
  • 7

1 Answers1

1

You've probably figured this out by now, but for future reference: you need to add the v8 library to your Qt project file. Adding libraries to your *.pro file goes something like this:

LIBS += -L/path/to/v8 -lv8

Then you need to include the v8 header file in your source as appropriate:

#include <v8.h>
Prismatic
  • 3,338
  • 5
  • 36
  • 59