R
Rex_chaos
I have define a MACRO varible as a common variable that be refered by
several classes.
#ifndef COMMON_VAR
#define COMMON_VAR 1
....
#endif
Whenever I want to change the value of common_var, I only need to
redefine it at the beginning of the source code. However, I am going
to compile all the classes into a library. That is, my code must link
to the library before I can use the classes. I found that redefine
the COMMON_VAR will no longer work because the classes has already
been compiled into a static library. How can I overcome this problem?
several classes.
#ifndef COMMON_VAR
#define COMMON_VAR 1
....
#endif
Whenever I want to change the value of common_var, I only need to
redefine it at the beginning of the source code. However, I am going
to compile all the classes into a library. That is, my code must link
to the library before I can use the classes. I found that redefine
the COMMON_VAR will no longer work because the classes has already
been compiled into a static library. How can I overcome this problem?