I am trying to run the following MWE:
#include <iostream>
#include <v8.h>
#include <node.h> // Also tried <nodejs.h>
using namespace std;
int main (int argc, char *argv[]) {
cout << "Hello, World!" << endl;
return 0;
} // End main ()
(I'm trying to follow the tutorial here, but there are many other sites which have similar examples.)
When I compile it with g++ ./Test.cpp
I get the following error message:
./Test.cpp:3:18 fatal error: node.h: No such file or directory
I know that Fedora renames node
to nodejs
, so I tried #include <nodejs.h>
instead. But I got the exact error.
./Test.cpp:3:18 fatal error: nodejs.h: No such file or directory
I know that /usr/include/nodejs
is present on my computer, and in that directory, there are all the files that are needed: such as node.h
, uv.h
, etc. But when I try #include <nodejs/node.h>
I get a different error:
/usr/include/nodejs/node.h:61:16: fatal error: uv.h: No such file or directory
So the linker is trying to find uv.h
in /usr/include/
instead of /usr/include/nodejs
. I can't seem to get the linker to look in the right place.
Can someone please help me? Thanks in advance.