LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

lvsound2 not getting bundled in compiled applications

Hi Folks,

 

I am building an application in LV2018 in which I am using several of the VIs under the "Sound VIs" palette. I noticed that this adds a lvsound2.dll dependency. When I build the application and try to run the exe, it will start up with a popup dialog for me to search for the lvsound2.dll.

 

I thought system dependencies are either installed with the run-time or should be packaged automatically? It seems like in this case neither are true?

 

I tried to drag and drop the lvsound2.dll from the dependencies tab into the main project...while it did let me do that, when I try to config the build, it won't let me add it to "always include". A warning displays "The selected file is not saved."

 

I next tried to add it manually from my LV2018/resource folder and that worked and was able to get it to compile and included in the "data" folder of my application. However, this still prompted the same issue with the pop up searching for the dll when I start the exe...which makes sense since this version of the lvsound2.dll is not actually called by anyone according to the project, only the one in the dependency tab is.

 

Is there a way to get lvsound2.dll to work properly with my application?

 

Regards,

Mike

0 Kudos
Message 1 of 3
(1,100 Views)

Alright, so messing around a bit more I found two paths out of this:

 

Note: In both cases, you need to add the lvsound2.dll independently from your "../Labview20xx/resource" directory

 

Path 1: Add lvsound2.dll to the root directory where the exe resides

  1. In Build settings > Destinations, create a new destination at the same level where the application exe resides (you should already have one that is named "your application.exe", but that one will not be selectable in the other menu
  2. Go to "Source File Settings", select lvsound2.dll and change the destination to the root directory name you set in step one
  3. Save and build your project. You should now get lvsound2.dll in the same folder as your application.exe and it should now load without a search popup dialog

Path 2: Use an installer and add lvsound2.dll to the run-time folder

  1. In your application (not installer!) build setting, go to Advanced, and uncheck the "Allow Future Versions of Labview Run-Time to run this application"
  2. Create an installer build spec. In the settings, go to "Source Files" > expand the Project Files View for your Application and locate lvsound2.dll
  3. Click on lvsound2.dll and then click on the "[Labview 20xx Run-Time]" Folder in the "Destination View" and click the right arrow
  4. This will install lvsound2.dll into the run-time directory of the application's LV version

Restriction on path 2 is that you will not be able to use future versions of lv runtime, so if you wanted to have some clean installation or bugfixes and just use the latest greatest Run time to run all applications compiled with older versions of LV, you won't be able to do that here because the LV you are compiling you with doesn't know that other run-times exists besides the version you are on.

 

If anyone else has any other solutions, I would love to hear it. Personally, I would go with solution 1, but I'd rather keep the dll with other dependencies in the /data/ folder instead of the root install directory.


Regards,

Mike

0 Kudos
Message 2 of 3
(1,056 Views)

@Mikejj wrote:

 

If anyone else has any other solutions, I would love to hear it. Personally, I would go with solution 1, but I'd rather keep the dll with other dependencies in the /data/ folder instead of the root install directory.


Regards,

Mike


Mike,

     Congratulations on finding a solution yourself.  Note you can mark your just-previous Post as the "Solution", or maybe try out a suggestion of mine (next paragraph) and, if it works and you like it, mark your "improved" version as the Solution.

 

     You said you'd rather keep the dll with the other dependencies in the /data/ folder.  So go ahead and put it there.  When you want to use it in Development mode, you know where to find it -- in the Project Folder in a top-level folder called "Data".  A while ago, I wrote a little VI for myself called "Data Folder" that would find the location of the folder \Data, assuming it was a top-level folder in the Project and also was left in its default "top-level folder" in the Executable.

Data Folder.png

This works by assuming you are either in "Development Mode", with Application Kind being "Development System", in which case you use the "Application Directory" (one of the File Constants in the File I/O Palette), or you are in "Run Time System" (i.e. running an Executable), in which case you use the "Application Directory" which, magically, now is wherever your Build Executable is living!  The default "Development System" Case is simply the "Not a Path" constant, which is used by the second Case Statement (the one you can't see here) to simply return "Not a Path", otherwise it returns the path of the Data sub-folder, creating it if necessary (the Green Vi is "Create Dir if Non-Existent", from the OpenG File Palette).  Note that you only will need this in Development Mode if you haven't put a \Data folder as a top-level folder in your Project folder.

 

Bob Schor

0 Kudos
Message 3 of 3
(1,033 Views)