I have file A.cpp that has targetlibs=Lib.lib on the sources file. Lib.cpp was compiled with C_defines=-DSomething, but A.cpp is compiled with C_defines=-DOther. Lib.pp contains #ifdefs for -DSomething and -DOther.

What happens in this case? Is -DSomething kept or replaced by -DOther? Is -DOther ignored? Or both are kept? Thanks

有帮助吗?

解决方案

Defines have an effect at compile time, so -DSomething is kept for the library code and -DOther for the program code. Be careful, if a header of Lib , eg Lib.h , is included in A.cpp,-DOther is used for the header code as well, since it is in the same compilation unit as A.cpp.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top