From: Daniel A. S. <st...@ic...> - 2001-04-05 22:47:50
|
Steve, sorry for the delay, maybe you've solved this problem already? At 11:38 +1000 on 30/3/01, Steve Cassidy wrote: >Note that originally this was a call to stat() but I replaced it >with Tcl_Stat for the mac. >I've been through various troubles with stat eventually finding out >that you can't include ><fcntl.h> anywhere as it gives a duplicate definition of stat. I don't understand this, Tcl already includes the MSL fcntl.h, so including it again should not cause a problem. are you sure you're including the correct fcntl.h (and/or stat.h)? there are probably several around, e.g. the MPW folder has a different one, so if your access paths are setup to loosely, you may get that one by mistake. IIRC some beta versions of Apple's Universal Interfaces also had some standard headers in them that conflicted with MSL's. also, you should be able to use MSL's stat, there is in principle no need to use Tcl_Stat, although it's probably a good idea. If that doesn't work already, it may help to pinpoint the problem. >When compiling this I get: > >Error : illegal use of incomplete struct/union/class 'struct stat' >trackdata_ssff.cpp line 84 stat *statbuff =3D new stat; >Project: emu.=B9, Target: Emu Shared Lib, Source File: trackdata_ssff.cpp > >Error : illegal use of incomplete struct/union/class 'struct stat' >trackdata_ssff.cpp line 91 track->file_num_rec =3D (statbuff->st_size >- In->Data_Seek_Pos)/In->One_Rec_Size; >Project: emu.=B9, Target: Emu Shared Lib, Source File: trackdata_ssff.cpp > >I've no idea what this means or how to get rid of it. My next step >is to try to use stat >in a small program but I wondered if anyone else had any insight >that might help. this looks like a consequence of a header conflict and of struct stat not being defined identically everywhere. do you know what file the definition of struct stat you use here comes from? Sorry to not be more helpful... Cheers, Daniel -- ** Daniel A. Steffen ** "And now to something completely ** Department of Mathematics ** different" Monty Python ** Macquarie University ** <mailto:st...@ma...> ** NSW 2109 Australia ** <http://www.maths.mq.edu.au/~steffen/> |