p****r 发帖数: 165 | 1 where to create the macro in compiler configuration, so when compile, it
will only compile part of the code that is defined by the macro? something
like
\D Load_FILE
thanks. |
G*****7 发帖数: 1759 | 2 i think you are looking for preprocessor definitions.
in your source code:
#ifdef Load_FILE
cout << "Load_FILE is defined";
#else
cout << "Load_FILE is not defined";
#endif
in your compiler settings, add:
-DLoad_FILE
without space between -D and your preprocessor definition. |
t****t 发帖数: 6806 | 3 他问的就是怎么设compiler option...
properties -> c/c++ -> preprocessor -> preprocessor definitions
【在 G*****7 的大作中提到】 : i think you are looking for preprocessor definitions. : in your source code: : #ifdef Load_FILE : cout << "Load_FILE is defined"; : #else : cout << "Load_FILE is not defined"; : #endif : in your compiler settings, add: : -DLoad_FILE : without space between -D and your preprocessor definition.
|
p****r 发帖数: 165 | 4 already got the answer. thanks.
【在 p****r 的大作中提到】 : where to create the macro in compiler configuration, so when compile, it : will only compile part of the code that is defined by the macro? something : like : \D Load_FILE : thanks.
|