Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

'/Zl' and 'Gy-' incompatible error when programing NI-845x in C/C++

Solved!
Go to solution

Hi, 

 

I'm trying to use the C example codes (basic reading and writing) of the NI USB-845x in MS Visual Studio 2019 Community. 

 

The basic writing example runs correctly with no error. But when I try to compile the reading code, it shows one error that is '/Zl' and '/Gy-' command-line options are incompatible'. The error seems not origin from the .c code file but the whole project. The compiler shows the error is at line 1 of the file 'cl', but I cannot find a file called 'cl' in the path the compiler shows to me (it shows the path of the project).

 

Screenshots are attached for both the error of the Reading code and the correctly compiled Writing code. My computer runs the Windows 8.1 and the 845x driver version is 17.0.

 

Do you have any suggestions that how can I solve this issue?

 

Thanks,

Eric

 

 

845x_C_Reading_Error845x_C_Reading_Error845x_C_Writing845x_C_Writing

0 Kudos
Message 1 of 2
(2,962 Views)
Solution
Accepted by topic author Eric1992

Found the Solution:

 

In the Visual Studio, go to Project -> Properties,

"/Zl" is in C/C++ -> General -> Debug Information Format,

"/Gy" is in C/C++ -> Code Generation -> Enable Function-Level Linking.

 

When "Edit and Continue" (/Zl) is chosen, Function-Level Linking should be enabled by choosing "/Gy" instead of "/Gy-". "/Gy-" means disable the Function-Level Linking and it is incompatible with the setting of "/Zl".

 

https://stackoverflow.com/questions/43141401/visual-studio-error-d8016-zi-and-gy-command-line-option...

 

https://docs.microsoft.com/en-us/cpp/build/reference/gy-enable-function-level-linking?view=vs-2019

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