由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - Visual studio: 2008: create a macro in compiler configuration
相关主题
spent a lot of time try to compile boostC++ template preprocessor
师傅们,C++概念题,弟子有礼了vc 2008: compilation error about header file
What syntax is this?(about macro)third party c/c++ code and compile it on win 7
如何用 preprocessor unroll for loop?从一个Embedded C++ quiz 调查看印度人的实力
问低级问题一个qt3在Windows上的问题
Python problem on 64 bit Linux什么地方有 free windows 的 C compiler download
macro and std:: function name clashingQuestion about a C++ compilation error on Visual Studio 2005
这个结果是啥,为什么呢?在 windows下的C++开发平台是不是 Dev-C++?
相关话题的讨论汇总
话题: compiler话题: macro话题: file话题: load
进入Programming版参与讨论
1 (共1页)
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.

1 (共1页)
进入Programming版参与讨论
相关主题
在 windows下的C++开发平台是不是 Dev-C++?问低级问题
error of compiling C# in visual studion 2013 win 7 (转载)Python problem on 64 bit Linux
c++ define 一问macro and std:: function name clashing
release Vs. debug???这个结果是啥,为什么呢?
spent a lot of time try to compile boostC++ template preprocessor
师傅们,C++概念题,弟子有礼了vc 2008: compilation error about header file
What syntax is this?(about macro)third party c/c++ code and compile it on win 7
如何用 preprocessor unroll for loop?从一个Embedded C++ quiz 调查看印度人的实力
相关话题的讨论汇总
话题: compiler话题: macro话题: file话题: load