Ok, but how can I get to /usr/include/unistd.h? CW9 in a standard C
Mach-o stationery project places its access paths (MSL, MacOS X Support
etc.) BEFORE usr/include, so if I #include unistd.h I get MW's one, not
/usr/include/unistd.h - and if I change the order of the access paths
so that unix ones are before MW's, I get an error from CW9 complaining
about the fact that its access paths are after unix ones! And, anyway,
the problem remains, because even if I can get the definition of
chdir(), still I can't find the implementation...
David Phillip Oster - 09 May 2006 15:02 GMT
> Ok, but how can I get to /usr/include/unistd.h? CW9 in a standard C
> Mach-o stationery project places its access paths (MSL, MacOS X Support
[quoted text clipped - 4 lines]
> the problem remains, because even if I can get the definition of
> chdir(), still I can't find the implementation...
I just tried it, and could not reproduce your problem.
I used CW9 to create a "C Toolbox Mach-o" variant of a standard C Mach-o
stationery project. I didn't need to touch the access paths. I didn't
need to add any frameworks.
The program:
#include <Carbon/Carbon.h>
#include <unistd.h>
int main(void){
InitCursor();
chdir("/");
return 0;
}
compiled and linked with no problems. Option clicking on the call the
chdir showed that it was declared in the correct unistd.h
One difference between you and me:
Using the "Preferences" menu command, under the Codewarrior menu, in the
Source Trees panel, I'd added the line:
Name Path
OS X Volume /Developer/SDKs/MacOSX10.3.9.sdk
And of course I do have that SDK installed from Xcode.
I hope this helps.
ultimatewarrior - 09 May 2006 17:20 GMT
SOLVED!
Thank you for your aid, but I solved the problem in a really
"quick-and-dirt" way by simply declaring the chdir() prototype as it
appears in the unix unistd.h file. It worked. I dunno why I still
cannot get to the unistd.h file in usr/include, however the workaround
is just ok for my needs...
Thanx very much for your help!