GithubHelp home page GithubHelp logo

Unable to install on Windows - error C2440: 'function' : cannot convert from 'THREAD_FUNC (__cdecl *)(void *)' to 'unsigned int (__stdcall *)(void *)' about npool HOT 7 CLOSED

inh3 avatar inh3 commented on August 10, 2024
Unable to install on Windows - error C2440: 'function' : cannot convert from 'THREAD_FUNC (__cdecl *)(void *)' to 'unsigned int (__stdcall *)(void *)'

from npool.

Comments (7)

inh3 avatar inh3 commented on August 10, 2024

Fixed the issue, sorry about that. Was missing the necessary __stdcall for the Windows thread function.

Already published to npm version 1.1.1 with the fix. Let me know if that works out.

from npool.

inh3 avatar inh3 commented on August 10, 2024

Left one file out getting that committed now.

from npool.

inh3 avatar inh3 commented on August 10, 2024

File is committed and published npool 1.1.2 to npm.

I'll close once you let me know your build is okay.

from npool.

naderchehab avatar naderchehab commented on August 10, 2024

The build is ok, thank you! However once I run a basic example such as this, I get the following error:

"E:\Program Files (x86)\nodejs\node.exe" npool-test.js
Process finished with exit code -1073741819

from npool.

inh3 avatar inh3 commented on August 10, 2024

Glad the build worked out!

unitOfWork.fileKey = 2;

This line should be:

unitOfWork.fileKey = 1;

This is because you are loading the file at index one here:

// load files defining object types
nPool.loadFile(1, __dirname + '/helloWorld.js');
  • fileKey uint32 - This parameter is an integer that is used as a key to reference a file that was previously cached via the loadFile function. At this time there is no run-time logic to handle the a case when a file key does not reference a previously loaded file. Therefore, ensure that a file exists for the given key.

from npool.

inh3 avatar inh3 commented on August 10, 2024

One more thing to note, if you want your program to terminate, you will need to destroy the thread pool at some point. The thread pool keeps the run script "alive" due to the background threads unless you destroy it explicitly.

So, add something like this to the end of your script.

// let the thread pool get to the work, then
// eventually get rid of the thread pool
setTimeout(function() {
    nPool.destroyThreadPool();
}, 500);

from npool.

naderchehab avatar naderchehab commented on August 10, 2024

D'oh - my bad. I will try this as soon as I get home! Thank you for your extremely speedy and thorough replies!

from npool.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.