LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot undefine macros in cvicc

Hello all,

in cvicc (CVI compiler for Linux), there's an option -DDEFINE to define a macro, but no equivalent -U to undefine it. It would be useful because the macros defined in [Options][Build Options][Compiler defines] are indeed used by cvicc when compiling on Linux. If I need a project-level macro defined on Windows but not on Linux, I don't know how to remove it except by parsing it out of the prj file before compilation.

0 Kudos
Message 1 of 5
(2,974 Views)

Hello,

 

Great input. Can you post this on NI Idea Exchange? That is where the developers look for input for software changes.

0 Kudos
Message 2 of 5
(2,938 Views)

Hello gdargaud,

 

If you want to have macros defined conditionally I suggest you to use a Precompiled Header instead of Compilers Defines in Build Options. Then in the prefix header add your defines conditionally:

#if _NI_mswin_
// windows defines
#define _MINUS_U
#else
// linux defines
#endif

You don't have to #include this header in *.c files because it is included automatically

 

I hope it helps.

Constantin

 

0 Kudos
Message 4 of 5
(2,913 Views)

Thanks Constantin,

I'd never noticed that CVI supports precompiled headers. With fast computers nowadays, I've never felt the needs for them, but I'll keep it in mind in that case.

0 Kudos
Message 5 of 5
(2,908 Views)