LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable Code based on OS at Compile Time

Hello. I am trying to create an application that can be compiled for the big three OS': Windows, Mac, Linux. I have some code that I wish to run on the Windows version that references DLL's. On Linux and Mac I don't care about these sections so I used a conditional disable structure that switches based on target type to switch between the windows code and the no-op for Linux and Mac. 

 

Cond_Dis.PNG

 

This works fine in source, however, when I compile the application, the build will fail on Mac or Linux because the sub-vis that exist within the Windows case of that structure are not executable, even though they will never be run. 

 

Is there a good work around or solution for this? Thanks.

 

 

0 Kudos
Message 1 of 2
(2,289 Views)

Hi!

Have you tried using "OS" instead of "TARGET_TYPE"?

Disabled code should not be considered while building the application.

 

Regards,

Marco

0 Kudos
Message 2 of 2
(2,267 Views)