Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Building a module with node-gyp

Received: by 10.58.117.41 with SMTP id kb9mr2377032veb.27.1348445955964;
        Sun, 23 Sep 2012 17:19:15 -0700 (PDT)
X-BeenThere: nodejs@googlegroups.com
Received: by 10.220.141.4 with SMTP id k4ls3749808vcu.8.gmail; Sun, 23 Sep
 2012 17:19:07 -0700 (PDT)
Received: by 10.52.35.104 with SMTP id g8mr1632374vdj.19.1348445947176;
        Sun, 23 Sep 2012 17:19:07 -0700 (PDT)
Date: Sun, 23 Sep 2012 17:19:06 -0700 (PDT)
From: Bert Belder <bertbel...@gmail.com>
To: nodejs@googlegroups.com
Message-Id: <46abc940-1a11-4b0f-a4f5-149e59c9ce62@googlegroups.com>
In-Reply-To: <6ae7b366-533e-4e31-b479-e626056c5a53@googlegroups.com>
References: <6ae7b366-533e-4e31-b479-e626056c5a53@googlegroups.com>
Subject: Re: Building a module with node-gyp
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1496_32837895.1348445946825"

------=_Part_1496_32837895.1348445946825
Content-Type: multipart/alternative; 
	boundary="----=_Part_1497_3205036.1348445946826"

------=_Part_1497_3205036.1348445946826
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On Sunday, September 23, 2012 10:17:48 PM UTC+2, NodeNinja wrote:
>
> 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?
>

Include <time.h> and <stdlib.h> 

------=_Part_1497_3205036.1348445946826
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Sunday, September 23, 2012 10:17:48 PM UTC+2, NodeNinja wrote:<blockquot=
e class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: =
1px #ccc solid;padding-left: 1ex;">Trying to build this&nbsp;
<a href=3D"https://github.com/substack/node-bigint" target=3D"_blank">https=
://github.com/substack/<wbr>node-bigint</a>&nbsp;module with node-gyp on wi=
ndows. This lib wraps around libgmp<div>It was previously using node-waf.</=
div><div><br></div><div>For gmp on windows I downloaded the static version =
for vc++ from here&nbsp;<a href=3D"http://www.cs.nyu.edu/exact/core/gmp/" t=
arget=3D"_blank">http://www.cs.nyu.edu/<wbr>exact/core/gmp/</a></div><div><=
br></div><div>and put in a &nbsp;folder called 'gmp' in the bigint root dir=
</div><div><br></div><div>then I created a binding.gyp file as&nbsp;</div><=
div><br></div><div><div>{</div><div>&nbsp; "targets": [</div><div>&nbsp; &n=
bsp; {</div><div>&nbsp; &nbsp; &nbsp; "target_name": "bigint",</div><div>&n=
bsp; &nbsp; &nbsp; "sources": [ "bigint.cc" ],</div><div><span style=3D"whi=
te-space:pre">=09</span> &nbsp;"include_dirs": [ "gmp" ]</div><div>&nbsp; &=
nbsp; }</div><div>&nbsp; ]</div><div>}</div></div><div><br></div><div>then =
I did&nbsp;</div><div><br></div><div>node-gyp configure</div><div><br></div=
><div>and it created a build folder in the bigint root dir</div><div><br></=
div><div>and then</div><div><br></div><div>node-gyp build..\bigint.cc(579):=
 error C3861: 'time': identifier not found&nbsp;</div><div>..\bigint.cc(579=
): error C3861: 'clock': identifier not found</div><div><br></div><div><div=
><br></div><div>This is the line number 579</div><div>unsigned long seed =
=3D rand() + (time(NULL) * 1000) + clock();</div></div><div><br></div><div>=
and this are the includes on top of bigint.cc</div><div><br></div><div><div=
>#include &lt;stdint.h&gt;</div><div>#include &lt;cstdio&gt;</div><div>#inc=
lude &lt;cstdlib&gt;</div><div>#include &lt;cstring&gt;</div><div>#include =
&lt;iostream&gt;</div><div><br></div><div>#include &lt;v8.h&gt;</div><div>#=
include &lt;node.h&gt;</div><div>#include &lt;gmp.h&gt;</div><div>#include =
&lt;map&gt;</div><div>#include &lt;utility&gt;</div><div><br></div><div>usi=
ng namespace v8;</div><div>using namespace node;</div><div>using namespace =
std;</div></div><div><br></div><div>Any idea why the error is being caused?=
</div></blockquote><div><br>Include &lt;time.h&gt; and &lt;stdlib.h&gt; <br=
></div>
------=_Part_1497_3205036.1348445946826--

------=_Part_1496_32837895.1348445946825--