Re: how to include a .cp file?
Re: how to include a .cp file?
- Subject: Re: how to include a .cp file?
- From: Chris Espinosa <email@hidden>
- Date: Fri, 30 Jan 2004 15:33:54 -0800
On Jan 30, 2004, at 3:24 PM, Jens Miltner wrote:
I'm trying to build a PowerPlant project to Xcode and I could swear
that I got it building once already, but for some reason, it won't
work anymore (might be some change in Xcode 1.1 that causes this). The
problem I'm facing is that UPrinting.cp includes
"USessionPrinting.cp", but Xcode fails to find this file.
I assume this is because Xcode caches the header files in it's
headermap, but it won't cache a .cp file, so it doesn't find the .cp
file...
Unfortunately, the "File Type" selection seems to have no influence on
that behavior: I tried to change the File Type from sourcefile.cpp.cpp
to sourcefile.cpp.h, but that didn't fix the problem.
(USessionPrinting.cp is added to the project, but it's not in the
target, since it's implicitely compiled by UPrinting.cp).
I tried with a small sample project and it's the same there:
----- file main.cpp:
#include "foo.cp"
int main()
{
foo();
}
------ file foo.cp:
static void foo() {}
Again, foo.cp is part of the project, but not compiled for the target
and Xcode claims it can't find "foo.cp"...
Is there any way to make Xcode recognize/find USessionPrinting.cp (or
any other .cp file that's being #included from another .cp file)?
The practice of using #include to bring in code files, rather than
headers, is discouraged in Xcode, but many source bases (like
PowerPlant) do it anyway.
You have to set up an access path so the compiler can find foo.cp,
because you're asking the compiler to compile it, not the Xcode build
system (which would know where it is if it's in the project). So add
the full relative path to USessionPrinting.cp to your target's Include
Paths. Use the Source trees feature (Xcode Preferences) to set up the
base path of your PowerPlant sources, as CW can find them relative to
its compiler, but Xcode cannot.
If this makes no sense to you, I can post step-by-step instructions.
Chris Espinosa
Apple
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.