LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Application cannot be built with class and interface in the same lvlib

Solved!
Go to solution

Hello everyone,

 

I have experienced the following weird behaviour with LV2020:

 

If you have a class and an interface (the two are not related in any way) in the same lvlib and your application is using the class then the build fails with this message: LabVIEW: (Hex 0x696) You cannot inherit an interface from a class. Interfaces inherit only from other interfaces.

 

image.png

0 Kudos
Message 1 of 4
(428 Views)

Update:

 

This error is related to the "Remove unused members of project libraries" option in the build spec:

If turned off then the app builds just fine and it is the same if all included classes & interfaces are used in the application.

0 Kudos
Message 2 of 4
(414 Views)

@ImreSzebelledi  已写:

Update:

 

This error is related to the "Remove unused members of project libraries" option in the build spec:

If turned off then the app builds just fine and it is the same if all included classes & interfaces are used in the application.


This behavior should be reported as a bug to NI. Uncheck "Remove unused memebers of project libraries" would cause some side effects when you're building a "real" application which is more complicated that this narrow-downed version. It should be fixed. 

 

And a workaround is to build the .lvlib to a Packed Library(.lvlibp) first then direct call VI's from the packed library rather than the lvlib.

0 Kudos
Message 3 of 4
(58 Views)
Solution
Accepted by topic author ImreSzebelledi

I have just checked with Labview 2020 SP1 and the bug seems to be fixed in that. The example builds just fine.

 

-Imre

0 Kudos
Message 4 of 4
(43 Views)