WellWellWell
WellWellWell

Reputation: 161

node-ffi : Dynamic Linking Error

I have a C++ method (which role is killing some processes), in a library Risk.dll.

On the other hand, I am developing a web-application (using Nodejs and AngularJS), running on Google Chrome. When I click on a button through the browser, I would like to be able to call the C++ function, through my app.js file.

I have decided to use Node-ffi, but I have the error :

Error: Dynamic Linking Error: "Risk.dll":

Here is my code on javascript :

var ffi = require('ffi')
//Kill Server
socket.on('killserver', function(date){

    var cTest =  ffi.Library("Risk", {
        "DateModified":["long", ["string"] ]
    });

    var res = cTest.DateModified(date);
    console.log(res)
});

In C++, I have done

extern C{
}

And I want to add that my file Risk.dll is in the same file than the file server.js I run with Node when I want to use my app.

Any clue ?

Upvotes: 2

Views: 3830

Answers (1)

towi_parallelism
towi_parallelism

Reputation: 1481

Try the 64-bit compiler which is normally found in C:\Program Files (x86)\Microsoft Visual Studio xx\VC\bin\amd64\cl.exe

Upvotes: 2

Related Questions