10-19-2010 02:08 PM
I've seen the FAQ about LabView, but what about vision libraries? If I make a dll or executbable on a 32 bit machine with the Vision development system, can I run that on a 64 bit machine? In particular, I'd like to compile the obj file into a MEX file (using Matlab), but that's another level.
thanks,
John
10-19-2010 02:56 PM
The Vision libraries are distributed as both 32-bit and 64-bit DLLs. On 64-bit Windows, 32-bit processes can be run natively. The bitness of any DLLs used in a process must match the bitness of the executable you are trying to run.
To summarize:
- If you produce a 32-bit EXE using Vision, you can run that on 32-bit or 64-bit Windows
- If you produce a 64-bit EXE using Vision, you can only run it on 64-bit Windows
- If you produce a 32-bit DLL using Vision, you can run it on 32-bit or 64-bit Windows, but only within a 32-bit process
- If you produce a 64-bit DLL using Vision, you can run it on 64-bit Windows, but only within a 64-bit process
If you are building a DLL, you could always produce both 32-bit and 64-bit DLLs from the same code to ensure you can run in both 32-bit and 64-bit processes (similar to the Vision libraries).
Eric
10-19-2010 09:58 PM
I assume I can build then build both the 64 bit DLLs or executables (and 32 bit) from a Microsoft 2010 compiler on a 32 bit machine? This seems like they would allow it but I haven't done it....
thanks!!
John
10-19-2010 11:34 PM
Hi John,
The underlying compiler Visual Studio uses can cross-compile 64-bit binaries from a 32-bit OS. However, I'm not entirely certain if the Visual Studio IDE will let you do this, or if it even installs the 64-bit compiler when on a 32-bit machine, since it cannot run/debug the 64-bit code on a 32-bit machine. Also, to link against the Vision libraries (or any other DLL) you typically link in a .LIB file (called an import library) so that all the symbols imported from the DLL can be resolved at link time. I'm not sure if the NI Vision installer will actually install the 64-bit version of this file when you install it on a 32-bit OS. You can call into a DLL manually without using an import library by using LoadLibrary()/GetProcAddress() but this would be quite a bit more complex.
For simplicity, I'd suggest that if you want to build 64-bit binaries you do it from a 64-bit machine. From it you can easily build 32-bit binaries as well.
Eric