Node.js native extensions on Windows - windows

I compiled the version v0.5.9 of node.js (I know, is unstable) using Visual Studio 2010 and I obtained node.exe to Windows 7. Now, I wrote the Hello World example (https://www.cloudkick.com/blog/2010/aug/23/writing-nodejs-native-extensions/) of the native extension use the same VS 2010 compiler on a dll file. Then, How I can "link" this dll with the node.exe? I know that in linux, the node-waf building tool is used but I don't know what I have to use to link them on Windows.
In my implementation, I can't use Cygwin or linux...is under Windows.
p.d.: I'm trying to create an OpenGL engine based on offscreen rendering (not WebGL)

Related

Building a third-party library for Visual Studio

The project I'm currently working on as an intern uses a number of 3rd party libraries (libCURL, OpenSSL, and others). I've noticed that there are a number of versions of the third-party .dlls used by the project, a developer selects which one they want to use depending on what version of Visual Studio they are developing in.
My task is to upgrade two of the libraries to a newer version (libCURL and OpenSSL). One way to do this is to build the libraries from the source files and then replace the old files with the new ones. This is what I want to do, as I think I'd learn more by doing that rather than using pre-built binaries.
My question is, what special thing do I need to do during the build process to make these two libraries work with Visual Studio 20XX? Is it as simple as building the libraries using the Developer Command Promp for Visual Studio 20XX? Alternatively, if I followed the official guides to build one of the libraries for Windows x64 (which is the bitness of the Windows I'm running), presumably the resulting files wouldn't work in Visual Studio 20XX? Why not? What are these "generic-ly built" versions of a library used for?

What are the different platforms/languages in which an app can be compiled and run on Windows without any prerequisites?

What are the different platforms/languages in which an app can be compiled and run on Windows without any prerequisites? I know of .NET but it requires the specific version of .NET to be present in the Windows installation.
C and C++, but Visual Studio defaults to dynamically linked library. Change the default to static and you will be fine.
That being said, ther are no compilers that come with windows. You must install a compiler to build the a program that will run everywhere after that. There are free version of the compiler in the Platform SDK and in mingw (Cygwin requires a dll).
If you are using Visual C++ as language and development tool, you may switch to Statically bound DLLs, which would produce larger binaries, but would run without any runtime-prerequisites. Visual C++ Runtimes are easily installable, can be distributed, or users may be asked to install them directly. If users are using Windows Update, they would anyhow get the latest VC runtimes.

Loading DLL on OSX

A repository has a C project in Visual Studio. The project is going to run on a mobile device. I am on OSX and would like to compile and contribute to the project. (Assume parallels is not an options, that I do not have a Windows license or a Visual Studio license) Just downloading the C files would be enough except they are also using DLL which are also windows only.
Is there any way I can reconstruct this in an OSX compiler so I can build the files?
It looks like you need a cross-compiler that produces a Windows binary on Mac OS X.
Have a look at the MinGW compilers for Mac OS X available here. You won't be able to use the existing Visual Studio project but MinGW should be sufficient to compile the C files and link to the provided DLLs.
You can download and install Wine using MacPorts or you can just use WineSkin which is a GUI Wrapper for Wine on MacOS X. Go and grab Visual Studio 2010 Express Edition ISO image and install the application on Wine. Then you can open the VS project and try compiling it.
Based on your comments I think you need to run Windows DLLs on OSX without using a Windows VM. Assuming that you can't recompile the DLLs to target OSX, I think that your only realistic solution is to use Wine.

Is it possible to run applications compiled by Visual Studio 2008 on Linux?

Is it possible to run applications compiled by Visual Studio 2008 on Linux? Is there plugin that can convert my project exe to a Linux runnable file?
As far as I know, there is no software that allows Visual Studio to generate non-Windows executables.
If it's a native executable (not .NET) you can try running it under WINE and see if that works. If it doesn't I'd guess the options are either to make it work with WINE or see if you can build it as a native Linux application. The latter will be rather painful if it's a GUI application, obviously, and I'd question if it is worth it. Porting a command line app might be doable but don't underestimate the work involved.
if you use dot net there is a MONO library that enables running some dot net application on linux.
but it not fully compatible.
Otherwise you can do it, (maybe using silverlite you would...)
Mono Project

What is the best way to build open source libraries DLLs for Windows developers to use?

I have several C free software/open source libraries that I develop on Linux and OSX with the GNU toolchain (automake, conf, flex, bison, gcc, ...) but I occasionally get requests to provide Windows DLLs. I'd like to be able to provide those without having to spend a lot of time and money with Windows Visual Studio development. I do have a Windows XP virtual machine available and I also know the software is portable as occasionally I get patches to make it build in on windows.
What approaches or tools should I be using? Cross compiling on Linux? using Visual Studio Express or something else? I would prefer something that is fully automated from a SVN repository. I do not count cygwin as a solution since that does not seem to provide what Windows developers need, as far I understand the issues - linking and DLLs.
You can try Mingw with MSYS, Visual Studio (Express) with SUA (subsystem for unix application) or Cygwin to compile programs that are automake/autoconf based (./configure && make to build under linux).
Unfortunately usually the lib file they create is not compatible with other compilers, so if you want your library to work with an application that is developed using Visual Studio, then you should use the VSC++ approach. Usually a lot of GNU projects (check gnuwin32) actually have VC compatible build scripts too, than can be compiled using "nmake"
You could use MinGW or install the MSVC command line tools from Visual Studio Express.
Either of those can be driven by command line scripts.
I imagine a cross compile from Linux would also work, but I have no idea how easy (or painful) that might be to get going.
This short article shows a simple cross compile of a Windows application & running that app under Wine:
http://www.linuxjournal.com/node/1005753
The Windows Software Development Kit includes Microsoft's C/C++ compiler (command line only with no visual tools), so you don't even need Visual C++ Express Edition. The Windows SDK is a free download from Microsoft.
If you're using http://www.cmake.org/, cmake can create the Makefile (for Unix) and project file (for Visual Studio). This is what for example the KDE project is using.
Visual Studio's compiler can be started from a Windows command line with 'devenv /build debug project.csproj' on the cmake generated file. This does however require a Windows (possibly in a VM) with a (potentialy free) Visual Studio installed.

Resources