Re: Target issue: Preprocessor Macros Not Used in Precompiled Headers
Re: Target issue: Preprocessor Macros Not Used in Precompiled Headers
- Subject: Re: Target issue: Preprocessor Macros Not Used in Precompiled Headers
- From: Chris Espinosa <email@hidden>
- Date: Thu, 20 Dec 2007 09:23:39 -0800
On Dec 19, 2007, at 11:47 PM, Ulf Dunkel wrote:
We can only tell if you provide the full compiler invocation line,
just dragging the "Compiling foo.m" line from the Build Results
window into the Mail reply will copy it in full.
I found that my problem using Preprocessor Macros has two parts, one
of which is already solved. Entering my desired identifier in the
application target's "Preprocessor Macros Not Used in Precompiled
Headers" works fine for a source file which belongs to the
application source itself.
But there are some frameworks and plugins of our own which are used
in the app. Another file in which I want to use a preprocessor macro
FOO belongs to a framework source.
I also added the macro to this Framework target now. When it is
compiled, I can drag the "Compiling foo.m" line from the Build view
into a TextEdit document and see that the option -DFOO is used for
compilation. Looks fine - but whatever I do, it has no effect on
this framework .m source file when I run the app.
Are there any restrictions for Preprocessor Macros, e.g. can they be
used only in Application target?
No, preprocessor macros are a general feature of the C language and
should work in any C (or Objective-C or C++) file in any target.
If you know what effect the macro should be having on the framework
source file, you can select that file, choose Preprocess from the
Build menu, and inspect the generated preprocessed source to see
whether it's doing what you want.
Also make sure that after you build the framework with the
preprocessor macro set correctly, that you rebuild and relink your
app, else it will continue to use the old framework.
If the framework code someone else has given you is not behaving
correctly when you set a preprocessor macro the way its authors have
told you to, you probably have to take the issue up with the
framework's authors.
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden