Welcome to MacBoardz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

A two liner that won't compile on CW 9.5

 
   Macintosh computer (Home) -> Programmer Code RSS
Next:  Any idea what __restore_fpr_23 is?  
Author Message
François Robert

External


Since: Jul 05, 2006
Posts: 3



(Msg. 1) Posted: Wed Jul 05, 2006 2:51 pm
Post subject: A two liner that won't compile on CW 9.5
Archived from groups: comp>sys>mac>programmer>codewarrior (more info?)

Dear NG

I need to add to a Photoshop plugin a function that takes an std::string
argument and creates a folder hierarchy using mkdir(). I am starting to
think this is not doable with CW 9.5 :

Config : I have CW 9.5 + Mac OSX Universal SDK 10.4

Issue : The following two lines will not compile :
#include <fstat.h>
#include <string>

with access paths set to
{Compiler}MSL/MSL_C (recursive)
{Compiler}MSL/MSL_C++ (recursive)
{Compiler}MSL/MSL_Extras/MSL_Common (recursive)
{OS X Volume}usr/include (not recursive)

Symptom : CW complains that identifier dev_t is redeclared (and gid_t
etc...)

I have exhausted all the combinations of access path order / #include
order etc : No matter what, some identifier is redefined or missing or
some include path is not found.

My question is thus:
What should be the target settings / #include order to compile those two
lines (which are merely a prerequisite for writing the function I need)
?

I believe that the problem is much deeper than it seems and that I am
unwittingly mixing MSL headers with BSD headers and that this is not
supported by CW (or at least only partially supported). However, I
cannot figure where this happens and how to avoid it.

Thanks for your help.
_______________________________________________________
François Robert
(to mail me, reverse character order in reply address)

 >> Stay informed about: A two liner that won't compile on CW 9.5 
Back to top
Login to vote
David Phillip Oste

External


Since: Apr 25, 2004
Posts: 974



(Msg. 2) Posted: Wed Jul 05, 2006 4:57 pm
Post subject: Re: A two liner that won't compile on CW 9.5 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article ,
"François Robert" wrote:

> Dear NG
>
> I need to add to a Photoshop plugin a function that takes an std::string
> argument and creates a folder hierarchy using mkdir(). I am starting to
> think this is not doable with CW 9.5 :
>
> Config : I have CW 9.5 + Mac OSX Universal SDK 10.4
>
> Issue : The following two lines will not compile :
> #include <fstat.h>
> #include <string>
>
> with access paths set to
> {Compiler}MSL/MSL_C (recursive)
> {Compiler}MSL/MSL_C++ (recursive)
> {Compiler}MSL/MSL_Extras/MSL_Common (recursive)
> {OS X Volume}usr/include (not recursive)
>
> Symptom : CW complains that identifier dev_t is redeclared (and gid_t
> etc...)
>
> I have exhausted all the combinations of access path order / #include
> order etc : No matter what, some identifier is redefined or missing or
> some include path is not found.
>
> My question is thus:
> What should be the target settings / #include order to compile those two
> lines (which are merely a prerequisite for writing the function I need)
> ?
>
> I believe that the problem is much deeper than it seems and that I am
> unwittingly mixing MSL headers with BSD headers and that this is not
> supported by CW (or at least only partially supported). However, I
> cannot figure where this happens and how to avoid it.
>

Checking /Developer/SDKs/MacOSX10.3.9.sdk and
/Developer/SDKs/MacOSX10.4u.sdk with:

find . -name "*stat.h" -print

shows that fstat isn't part of either SDK. Checking the MSL folder
inside the Codewarrior folder shows that it doesn't have an fstat.h
either.

Lastly, a check of /usr/include also fails to find an fstat.h

man fstat

shows that fstat wants:
#include <sys/types.h>
#include <sys/stat.h>

Adding those to a the HelloWorld.cp of a new "C++ console Mach-O" style
C++ project shows it compiles with no problems. (I've got

"OS X Volume" set to /Developer/SDKs/MacOSX10.3.9.sdk on the Source
Trees panel of the IDE preferences.

I also tried it with "OS X Volume" set to / in the project's
Preferences' Source Tree panel.

I can't make it fail!

 >> Stay informed about: A two liner that won't compile on CW 9.5 
Back to top
Login to vote
François Robert

External


Since: Jul 05, 2006
Posts: 3



(Msg. 3) Posted: Thu Jul 06, 2006 7:13 am
Post subject: Re: A two liner that won't compile on CW 9.5 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

David Phillip Oster wrote in


> In article ,
> "François Robert" wrote:

....
> fstat wants:
> #include <sys/types.h>
> #include <sys/stat.h>
>
> Adding those to a the HelloWorld.cp of a new "C++ console
> Mach-O" style C++ project shows it compiles with no problems.
> (I've got "OS X Volume" set to /Developer/SDKs/MacOSX10.3.9.sdk
> on the Source Trees panel of the IDE preferences.)

My mistake(s) : The brain was thinking "stat" but the hand typed
"fstat"... I meant :
#include <stat.h>

But I think you pointed out the solution, too :
It should be (as documented) :
#include <sys/stat.h>

and not merely :
#include <stat.h>

and the access path should not contain the MSL_Extras part. That way, it
compiles (and run).

FYI : on my Mac I do have an MSL stat.h in
..../Metrowerks CodeWarrior/MSL/MSL_Extras/MSL_Common/Include/sys/stat.h

_______________________________________________________
François Robert
(to mail me, reverse character order in reply address)
 >> Stay informed about: A two liner that won't compile on CW 9.5 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Win compile error with CW 8 - Hi im compiling a small library for windows and im getting 3 undefined symbols. Could anyone point me to the library i need to include in the project? Or maybe what might be going wrong? I have these libs in the project already in this order: ..

Can't compile with 8.3 and Panther - Hello, Using Panther now, I just tried to compile my app and I get header compile include errors. For example, Error : ';' expected (included from: Movies.h:24 MediaHandlers.h:24 Quicktime.h:30 Engine.h:74 main.cpp:1) ImageCompression.h line....

dylib doesn't compile - Hello I'm trying to compile a dylib, but that doesn't seem to work. Link Error : undefined: '_mh_execute_header' (unknown) Referenced from 'start' in crt1.o Link Error : undefined: 'main' (code) Referenced from 'start' in crt1.o Also if i try t...

Problem of compile - I use codewarrior create a PowerPlant project, and I select Multi-Target. Compiled this project, received four waring. Link alert warning: The resource 'ALRT' which overlaps (251) (inside 'PP Debug Support.rsrc') you ignored. Link alert warning: The..

Just upgraded to CW9 -- can't compile! - I just upgraded from CW8 to CW9. I successfully registered the software and did the CW9.3 update. I created my first project and attempted to compile. Here is what I get: Error : Unable to use the plugin "Metrowerks C/C++". It is lice...
   Macintosh computer (Home) -> Programmer Code All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]