07-20-2015 03:17 AM
Hi,
I have a project that controls a piezo stage. This is done via a DLL from the manufacturer and I used the "Import -> Shared Library" wizard to make it a lvlib library in the user.lib folder. The lvlib folder contains a bunch of VIs and two DLLs (one from the manufacturer and one I believe to come from LabView: wdapi1120.dll).
The VIs from this project are now used in another project which brings several hardware control projects together. The lvlib file properly shows up under dependencies of this meta-project.
I then tried to build a standalone executable but the application builder stripped away one of the two DLLs from the lvlib: wdapi1120.dll. This leads to two error messages (see attached images). The workaround I found was to uncheck "Additional Exclusions -> Remove unused members of project libraries" so it is working now.
But I am still wondering, why the application builder strips a way a DLL file that was placed there by LabView before? I guess it checks for references. So if there is no reference, why is it required then?
My feeling is that I am missing something here so any clearification would be great.
Solved! Go to Solution.
07-20-2015 08:17 AM - edited 07-20-2015 08:18 AM
This DLL is not a LabVIEW DLL but a dependency of your first DLL. And this DLL was only placed by LabVIEW into the lvlib if there was any VI explicitedly accessing it. Otherwise it was added in there by whomever created the driver and LabVIEW interface.
Since your project doesn't call any VI that references this DLL the application builder determines that it is unused and removes it if you check the according option. There is no generic way for LabVIEW to determine that your DLL needs this second DLL other than reimpleminting the entire Windows executable loader in LabVIEW, which definitely is beyond the scope of what LabVIEW should ever attempt.
07-20-2015 09:17 AM
I was wondering how the application builder then knew about the file. But I just retried creating the library from the DLL and it did not put that additional one so I guess I must have put it there when creating the library. Then it all makes sense.
It's a bit unfortunate that the application builder has no feature to explicitly include a given file in the build folder but that should not be a big problem. Thanks for the reply!
07-20-2015 09:19 AM
Hi ehrlich,
It's a bit unfortunate that the application builder has no feature to explicitly include a given file in the build folder
Why not?
You can include any file you like in your build settings! All you need to do is to include it somewhere in your project, then you can include it in the build specs too!
07-20-2015 10:31 AM
Ah, that's a nice solution. I didn't consider that. Instead, I made a post-build VI that copies the DLL. Well, why choose the easy way...
07-20-2015 02:29 PM
You couldn't just manually add it to your project?
07-21-2015 01:42 AM
I guess that is what GerdW meant, I just didn't think about it and didn't try afterwards. It's probably working.
07-21-2015 07:14 AM
I would say it's most definitely working. It's not a wrong way to do it, just a different way. And it's kind of fun to build a post-build VI, besides. 😄