LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW 8.2 exe / dll issue

Hi,

I'm having a dll function call issue.  I'm calling a dll function via the 'Call Library Function' node, something I've done a million times.  If I use application builder to build an exe, then run the vi that calls the dll function on a machine that has the complete LabVIEW development environment, I have no problems.  However, if I try to run the exe on a machine with only the 8.2 runtime, I get an error (error code 42, 'generic error').

I've attached a simple test case that calls a dll function, one that takes two doubles, adds them, and then returns the result (real simple).  If I run the exe on my development machine, no issues.  If I run the exe on a machine with only the runtime, I get error code 42, 'generic error'.  Any ideas here?  I'm completely baffled at this point...

Thanks for the help,
Steve
0 Kudos
Message 1 of 5
(3,138 Views)
It may be an issue with the file path for the DLL. To make it easy to see if your file path is correct place indicators on the front panel of the exe so you can see if the path to the DLL is correct.
Andrew Alford
Production Test Engineering Technologist
Sustainable Energy Technologies
www.sustainableenergy.com
0 Kudos
Message 2 of 5
(3,115 Views)
Yep, that's a typical problem, but not in this case -- the path to the dll is fine (there's actually a debug switch on the block diagram that displays the dll path in a dialog box).  So, I will continue to wait and see if anyone else has any good ideas...
0 Kudos
Message 3 of 5
(3,110 Views)
Hey Steve,
      Outside of some executable build settings, the only thing that I can think of is some dependency that is not being linked in correctly.  I'll setup a PC here to test on, and figure out the source of the error code.  Thanks for all the info.


Brian B
Account Manager
National Instruments
0 Kudos
Message 4 of 5
(3,093 Views)
Hi Brian,

I figured out what the issue is -- in Visual Studio 2005, when you build a dll, there is a setting that defaults to using a multi-threaded dll for the runtime library (I'm not sure why VS2005 defaults to this, since the magic dll you need is only installed if you have VS2005 installed).  So, the short story is that there is a dll missing -- once I changed the default to statically link in the required runtime functionality, all is well. 

FYI, in case someone else runs into this (which I'm sure they will), the setting that causes this problem is 'Runtime Library' under 'C++ Code Generation' in the VS2005 project settings.  This setting defaults to 'Multi-Threaded DLL', but if you change it to just 'Mutli-Threaded', everything works fine (again, the required funcitonality is then just statically linked in versus using a dll).

Thanks for the help,
Steve
Message 5 of 5
(3,081 Views)