Building a nodejs addon without modifying C library - node.js

I have searched a lot here about the steps to create a add-on for a C library. I see there are plenty of tutorials online on how to build a add-on using the node-gyp. All of them involved creating a .cc file which is built by the node-gyp. Is there a way to build .c files directly as well. I do have a custom c library (.c, .h and also a compiled .dll for the same files). Is there a way to directly use the functions from the custom library without making any modifications to the source files? Most of the examples online have the v8 and uv header files included in it. The C library I have is a more generic and cannot be modified by me. Any help would be greatly appreciated. I did try to use node-ffi but it doesnt seem to be working with the newer versions of node-js.
Thanks,

Related

Building the client oflibmysqlclient on Windows with MSVC

ALL,
Does anyone succeeds building a client to libmysqlclient on Windows?
Following this instructions I can build the library itself
But then trying to follow mySQL documentaton which reads
To specify header and library file locations, use the facilities provided by your development environment.
With the old mySQL-Connector-C I was able to download just the code for the connector build it and then it had only 1 mysql.h
With the new library (8.0) I have t get the whole package, and there fore it will have multiple copies of mysql.h (yes, I did check by dong search of the file from Windows Explorer and Terminal/Bash).
In terms of library - it is easy as it will be hopefully just one and I can sue -L option for the linker.
But how do I get the proper include folder?
TIA!!
BTW, the tag here needs t be changed - it is not called connector-c anymore

How to use Node-API to include .dll written in C++

My aim to use third party library .dll (LibFT4222) with Node-API in Nodejs. In provided library I have .dll file, .lib file and 1 header file.
I am completely new in nodejs world and have watched and read some tutorials online about how to use node-api to do it. But I could not able to join dots from these tutorials to get my work done.
Can anyone please help me how to do it or provide me link to an example where it has been done already.
Please inform me if you need any other information.
Thanks !!

When using someone else's application code do I need to run Cmake to get the project structure for my operating system.

I am getting into a position where I have to use other people code for projects, for example openTLD. I want to change some of the code to give it more functionality and use it in a diffrent way. What I have found is that many people have packaged their files in such a way that you are supposed to use
cmake
and then
make
and sometimes after that
make install
I don't want to install the software on my system. What I am looking to do is get these peoples code to a point where I can add to it in Eclipse or even just using Nano and then compile it.
At what point is the code in a workable/usable state. Can I use it after doing cmake or do I need to also call make? Is my thinking correct that it would be better to edit the code after calling cmake as opposed to before? I am not going to want my finished code to be cross platform supported, it will only be on Linux. Is it easer to learn cmake and edit the code befor running cmake as opposed to not learning cmake and using the code afterwards, if that is possible?
You question is a little open ended.
Looking at the opentld project, there is a binary and a library available for use. If you are interested in using the binary in your code, you need to download the executables(Linux executables are not posted). If you are planning to use the library, you have two options. Either you use the pre-built library or build it during your build process. You would include the header files in your custom application and link with the library.
If you add more details, probably others can pitch in with new answers or refine the older ones.

Using minizip in Visual C++ 2010

I've been programming for a while, but for some reason I just can't find how to do something that I know has to be simple. I want to create zip files with a small utility that does not require dlls or any other helper files. I found a few places that recommend using zlib and minizip to work with zip files. I just can't figure out HOW to use them. I've installed zlib, but I have no clue how to install or use minizip. Every thing I find assumes I already have my environment set up to use it and "all you need to do is use function X and voila!" I've been trying to find how to use external libraries, but I'm getting just as vague info that way too. Are there any books that might be a place to start looking? I'm all for educating myself, but I'm actually quite lost with where to start on this.
Checkout XZip on CodeProject: http://www.codeproject.com/KB/cpp/xzipunzip.aspx
If you don't want to have to use any DLL's, that is a way to go. I've been using the 7-Zip DLLs with C# .NET programs lately. The 7-Zip SDK itself is not fun to work with, and all the solutions I know of that really work require the 7-Zip DLLs. However, once you integrate 7-Zip, you have ZIP, TAR, RAR, just about every other archive format integrated. The 7-Zip format itself is my favorite as it generally offers the best compression.
For .NET managed code, the SevenZipSharp library makes integrating the 7-Zip DLLs a snap:
http://sevenzipsharp.codeplex.com/

Building Dynamic Library for a complex project using makefiles on Linux

I'm trying to build a shared library on Linux having different modules, and since source files are spreded in different sub directories, I am having trouble figuring out how to create scripts and makefiles to compile the whole project as a single Dynamic shared Library with modules depending on other modules.
Could anyone please give me any examples or tutorials to help me ?
I always found this article useful:
Static, Shared Dynamic and Loadable Linux Libraries
From there you'll want to do a tutorial on Make.

Resources