11-06-2020 02:40 AM
I have LV2020.
I made a LVLIB that contains a class which methods are wrappers around a .NET DLL.
This DLL is placed inside a subfolder "DLL" (inside the folder of this LVLIB)
Then in another project, I have a Main.vi that uses this LVLIB.
So far so good.
When I build the exe into \Build folder, LabVIEW automatically copies that DLL into the build output folder (as expected). The exe works fine, pointing to the dll in its folder.
So far so good.
Now, if I close LabVIEW, re-open it, load the project (with Main.vi), I get a notification that the dependecy of the DLL was EXPECTED in \DLL BUT was loaded FROM the BUILD FOLDER.
It's like all my LVLIB re-linked into the copied DLL.
Also, if I rebuild the project, I get an error, because LV tries to copy the DLL into the output folder (ok) BUT the dll IS IN USE, so LV can't copy into a file that is somehow in memory.
Any idea why this happens?
thanks
Solved! Go to Solution.
11-06-2020 10:34 AM
Is there a DLL in the build folder and not the DLL folder? If not, I suspect you're reading the message backwards and it's saying it is looking in the build but finding it in the DLL.
In either event, the DLL is loaded into memory in your first steps. When you close and restart things, it's no longer loaded so it has to look.
It has a relative path that it's looking for the DLL in. If it doesn't find it there, it looks in a few other places. If it finds it there, it loads from that place instead.
Are the relative paths from the exe and the vi the same?
11-06-2020 11:18 AM
If you have your LVPROJ file in a directory, and that directory has a subdirectory containing your build folder, it will look in the build folder for DLLs and relink things there. You need to move your LVPROJ file to a subdirectory that doesn't have a build folder in it.
For instance, if you currently have this:
C:\Code\Project.LVPROJ
C:\Code\Build\App.EXE
C:\Code\Build\Data\Whatever.DLL
Change it to this:
C:\Code\Project\Project.LVPROJ
C:\Code\Build\App.EXE
C:\Code\Build\Data\Whatever.DLL
11-09-2020 02:03 AM
thanks.
It was the fact that I had the \build folder as subfolder of the project.
Now I understand why by default it's put outside.