02-05-2024 09:15 AM
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
02-05-2024 10:42 PM
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
Path 2: Use an installer and add lvsound2.dll to the run-time folder
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
02-06-2024 04:30 PM - edited 02-06-2024 04:31 PM
@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.
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