Node-gyp: error compiling win_delay_load_hook.c with visual studio preview 2

Created on 6 Jun 2016  路  12Comments  路  Source: nodejs/node-gyp

Apparently header changed since visual studio 2015 update 3 setting const to PfnDliHook

// Prior to Visual Studio 2015 Update 3, these hooks were non-const. They were
// made const to improve security (global, writable function pointers are bad).
// If for backwards compatibility you require the hooks to be writable, define
// the macro DELAYIMP_INSECURE_WRITABLE_HOOKS prior to including this header and
// provide your own non-const definition of the hooks.

Probably should include this in win_delay_load_hook.c source file

ifndef DELAYIMP_INSECURE_WRITABLE_HOOKS

define DELAYIMP_INSECURE_WRITABLE_HOOKS

endif

Windows

Most helpful comment

Use npm next: npm install -g npm@next

Fixes the problem on Win 10

All 12 comments

Would const-ifying __pfnDliNotifyHook2 in src/win_delay_hook.c work?

/cc @piscisaureus

Yes apparently it looks fine

Christian Taltas
KPMG Technologies Services - Directeur G茅n茅ral
[email protected]:[email protected]
+44 7482003570tel:+44%207482003570

On Mon, Jun 6, 2016 at 10:28 AM -0700, "Ben Noordhuis" <[email protected]notifications@github.com> wrote:

Would const-ifying __pfnDliNotifyHook2 in src/win_delay_hook.c work?

/cc @piscisaureushttps://github.com/piscisaureus

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/nodejs/node-gyp/issues/949#issuecomment-224028256, or mute the threadhttps://github.com/notifications/unsubscribe/ABSNupFj_eYN9G_t408zGc2LNMfO0Mmqks5qJFivgaJpZM4Iu8nU.

No objections to const-ification from me.

Okay, it clearly doesn't work with older VS versions. I'm not going to look into it deeper but I'll be happy to review patches.

@orangemocha you have time to dig into this?

I am investigating...

Just installed the latest Visual C++ Build Tools and getting the same error with [email protected].

Update: The header C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\delayimp.h has the const like in VS2015.

@RanzQ Can you file a new issue and include the build log?

@bnoordhuis Sorry, this was a false alarm. I'm having some problems installing the 3.4.0. npm list --global --depth=0 shows I've got 3.4.0 but I still have 3.3.1 in my global node_modules.

Use npm next: npm install -g npm@next

Fixes the problem on Win 10

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chen4393 picture chen4393  路  3Comments

Flimm picture Flimm  路  3Comments

jlchereau picture jlchereau  路  3Comments

good-idea picture good-idea  路  3Comments

kimown picture kimown  路  3Comments