Building a module with node-gyp

122 views
Skip to first unread message

NodeNinja

unread,
Sep 23, 2012, 4:17:47 PM9/23/12
to nod...@googlegroups.com
Trying to build this  https://github.com/substack/node-bigint module with node-gyp on windows. This lib wraps around libgmp
It was previously using node-waf.

For gmp on windows I downloaded the static version for vc++ from here http://www.cs.nyu.edu/exact/core/gmp/

and put in a  folder called 'gmp' in the bigint root dir

then I created a binding.gyp file as 

{
  "targets": [
    {
      "target_name": "bigint",
      "sources": [ "bigint.cc" ],
 "include_dirs": [ "gmp" ]
    }
  ]
}

then I did 

node-gyp configure

and it created a build folder in the bigint root dir

and then

node-gyp build..\bigint.cc(579): error C3861: 'time': identifier not found 
..\bigint.cc(579): error C3861: 'clock': identifier not found


This is the line number 579
unsigned long seed = rand() + (time(NULL) * 1000) + clock();

and this are the includes on top of bigint.cc

#include <stdint.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>

#include <v8.h>
#include <node.h>
#include <gmp.h>
#include <map>
#include <utility>

using namespace v8;
using namespace node;
using namespace std;

Any idea why the error is being caused?





Bert Belder

unread,
Sep 23, 2012, 8:19:06 PM9/23/12
to nod...@googlegroups.com

Include <time.h> and <stdlib.h>
Reply all
Reply to author
Forward
0 new messages