# Build custom node using C++ DLL

**URL:** https://discourse.nodered.org/t/build-custom-node-using-c-dll/49527
**Category:** Developing Nodes
**Created:** [9 August 2021 11:46 UTC](https://discourse.nodered.org/t/build-custom-node-using-c-dll/49527 "2021-08-09T11:46:25Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![FiloCara](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/filocara/32/27473_2.png) [@FiloCara](https://discourse.nodered.org/u/FiloCara)
#### Post date: [9 August 2021 11:46 UTC](https://discourse.nodered.org/t/build-custom-node-using-c-dll/49527/1 "2021-08-09T11:46:25Z")

</div>

Hello,

Newbie question here.  
I would like to build a custom node to get images from a thermal camera directly in Node-Red. In order to do that I need to create a NodeJS wrapper to a C++ DLL available in the camera SDK. The SDK is available online either for Windows and Linux.  
Here the question, what is the best way to package a node which uses an external compiled library? Should I let the user download the SDK or should I create a script for automatically downloading the SDK from the remote server?

Thank you in advance,

Filippo

---

<div class="post-metadata">

### Author: ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)
#### Post date: [9 August 2021 12:08 UTC](https://discourse.nodered.org/t/build-custom-node-using-c-dll/49527/2 "2021-08-09T12:08:22Z")

</div>

We can't really answer that question easily.

While I would lean towards making it as easy as possible for the user (e.g. a script that downloads and installs it) it will depend on under what restrictions the SDK is made available. It may be that the people providing the SDK require users to accept certain terms and conditions before downloading, that would mean that a script would circumvent that requirement.

---

<div class="post-metadata">

### Author: ![FiloCara](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/filocara/32/27473_2.png) [@FiloCara](https://discourse.nodered.org/u/FiloCara)
#### Post date: [10 August 2021 09:02 UTC](https://discourse.nodered.org/t/build-custom-node-using-c-dll/49527/3 "2021-08-10T09:02:12Z")

</div>

Thank you for the answer.

I completly understand. I think I will start by letting user downloading the SDK. In the documentation I will explain how to get the SDK and how to properly configure the node.

---

<div class="post-metadata">

### Author: ![kevinGodell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kevingodell/32/27040_2.png) [@kevinGodell](https://discourse.nodered.org/u/kevinGodell)
#### Post date: [10 August 2021 11:16 UTC](https://discourse.nodered.org/t/build-custom-node-using-c-dll/49527/4 "2021-08-10T11:16:05Z")

</div>

Will you be writing it in C++ as a nodejs addon?

---

<div class="post-metadata">

### Author: ![FiloCara](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/filocara/32/27473_2.png) [@FiloCara](https://discourse.nodered.org/u/FiloCara)
#### Post date: [10 August 2021 13:43 UTC](https://discourse.nodered.org/t/build-custom-node-using-c-dll/49527/5 "2021-08-10T13:43:14Z")

</div>

Hi Kevin,

No, actually I'm using the [node-ffi-napi](https://github.com/node-ffi-napi/node-ffi-napi) module. Not sure it is the best way to do that but, it is definitely the easiest way to call the DLL functions within NodeJS.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [9 October 2021 13:43 UTC](https://discourse.nodered.org/t/build-custom-node-using-c-dll/49527/6 "2021-10-09T13:43:39Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
