Jump to content

LuaVIEW and external DLL libraries


Recommended Posts

Using LuaVIEW v1.2, I require the use of an external function library (BitOp <http://bitop.luajit.org/api.html>). I have already compiled it from C into a DLL, and my intent is to call a couple of its bit-wise functions from a Lua script, which is invoked from LuaVIEW, which is of course invoked from LabVIEW. The function call is working just fine on my development machine, which has a full LabVIEW development environment (v8.5.1), the full LuaVIEW package (v1.2), and a complete installation of the Lua interpreter (v5.0). The problem is that in the deployed environment (Win XP), the very same DLL is not found by the function call. I have poured over the Lua documentation concerning the package.path, package.cpath, package.loaders, package.loadlib, etc.; and nothing I have tried has resulted in the function call being able to find this library and run. Are there elements missing from the deployed environment that prevents what I am trying to do? Has anyone else tried to use a third-party DLL function library in a deployed LuaVIEW environment, and succeeded?

Any pointers would be very appreciated.

TimV

Link to comment

Using LuaVIEW v1.2, I require the use of an external function library (BitOp <http://bitop.luajit.org/api.html>). I have already compiled it from C into a DLL, and my intent is to call a couple of its bit-wise functions from a Lua script, which is invoked from LuaVIEW, which is of course invoked from LabVIEW. The function call is working just fine on my development machine, which has a full LabVIEW development environment (v8.5.1), the full LuaVIEW package (v1.2), and a complete installation of the Lua interpreter (v5.0). The problem is that in the deployed environment (Win XP), the very same DLL is not found by the function call. I have poured over the Lua documentation concerning the package.path, package.cpath, package.loaders, package.loadlib, etc.; and nothing I have tried has resulted in the function call being able to find this library and run. Are there elements missing from the deployed environment that prevents what I am trying to do? Has anyone else tried to use a third-party DLL function library in a deployed LuaVIEW environment, and succeeded?

Any pointers would be very appreciated.

TimV

Where did you try to put the DLL in the executable and what cpath did you use? It's been a while that I dealt with this issue for an application so I'm not sure about the details at this moment. I do remember something about that it didn't work properly without the compat-5.1 fix that was floating around at that time.

And being busy to go through all the tests for the new beta package makes this also a bit harder. But I will look into it as soon as the beta is released.

Could you maybe provide a small example project that shows the problem? That would certainly accelerate the issue a lot.

Link to comment
  • 2 weeks later...

I spent several hours last Friday on this, and was unable to get either of loadlib or require to find the DLL in the runtime (deployed) environment. However, while re-reading the LuaVIEW manual, I (re)discovered the statically linked "lv" library, which includes bitwise functions! This solved my original problem. Although it still bugs me that I should have been able to get a dynamically linked library to work, I will hopefully not need to do so again until I am up and running with LuaVIEW v2.0, which will probably make it much easier (due to the Lua 5.1 module system). Thanks for the help though.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.