LVLIBs are great for a number of things, but they can become a pain when used in a built plugin-architecture (exe + source distribution with plugins). I propose a couple of the worst pitfalls gets ironed out by improving the build script and process:
1) When an LVLIB includes a public polymorphic VI, which member functions also resides in the LVLIB but are private, a build including this LVLIB breaks with (a somewhat weird) error code 1502 (Cannot save a bad VI without its block diagram) if "Remove unused polymorphic VI instances" has been checked in the build script.
The build failure is ok, but error code 1502 makes this case hard to debug. The reason for the failure is of course that you configure the build to remove the poly-VI, leaving the instance in its place. But the instance is in private scope thus rendering the calling VI broken during the build process. I propose the "Remove unused polymorphic VI instances" setting only removes the poly-VI when this will not break the code.
2) When both an executable and a source distribution (from which your exe calls a dynamic VI) use the same LVLIB, you risk ending up with a broken dynamic VI at runtime if "Remove unused members of project libraries" is checked in either of the build scripts. This is due to the fact that the LVLIB will only go into memory once (when the exe loads), and the source distribution will then be forced to use this copy of the LVLIB. If the exe build removed instances from the LVLIB that the dynamic VI should've used, the dynamic VI will be broken at runtime. Also quite hard to debug. The solution is to configure the LVLIB as "Always Included" in both build scripts, but this is error-prone. Instead I propose either to split the "Remove unused members of project libraries" setting up into a separate setting for each library type, or maybe have a new page in the build script letting you configure this setting for each of the LVLIBs in this specific build (automatically identified from inclusions and dependencies). Anybody can chime in here with their preferred solution.
Cheers,
Steen
NB. I must add that suggesting just to disable those two options in the build script isn't a good solution. That usually results in a very lengthy build process and a huge exe/source distribution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.