LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Application Builder strips DLL

Solved!
Go to solution

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.

Download All
0 Kudos
Message 1 of 8
(3,416 Views)
Solution
Accepted by topic author ehrlich

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.

 

Rolf Kalbermatter
My Blog
Message 2 of 8
(3,335 Views)

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!

0 Kudos
Message 3 of 8
(3,309 Views)

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(3,304 Views)

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...

0 Kudos
Message 5 of 8
(3,284 Views)

You couldn't just manually add it to your project?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 8
(3,265 Views)

I guess that is what GerdW meant, I just didn't think about it and didn't try afterwards. It's probably working.

0 Kudos
Message 7 of 8
(3,229 Views)

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.  😄

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 8
(3,194 Views)