Tcl 8.5 and Xcode 3.0

View: New views
4 Messages — Rating Filter:   Alert me  

Tcl 8.5 and Xcode 3.0

by Peter Kämpf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I recently replaced my G4 Powerbook with an Intel-based MacBook and  
switched to Tcl 8.5, OSX 10.5 and Xcode 3.0. On the G4 Mac I had  
successfully compiled a mixed Fortran-C application as a dynamic  
library to load into Wish 8.4 using Xcode 2.4. Trying to compile the  
same stack of files on Xcode 3.0 (gfortran 4.3, gcc 4.0.1) produces a  
lot of errors from the Tcl 8.5 header files linked to my C application.

Background: I need the C file to link into Tcl, but all the rest is in  
F90, which I am much more familiar with. Maybe it is something obvious  
to someone more into C.

The errors occur in /Developer/SDKs/MacOSX10.5.sdk/usr/include/
tclPlatDecls.h and look like this. The corresponding line looks quite  
innocent to me:
        /Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:102: error:  
syntax error before 'procPtr'
        /Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:103: error:  
syntax error before 'resource'
        /Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:105: error:  
syntax error before 'Handle'
        /Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:106: error:  
syntax error before 'OSType'
and so on, for a total of 32 errors.

Could please someone give me a hint what is happening here?

Thanks,

Peter


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: Tcl 8.5 and Xcode 3.0

by Philip Aker-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 08-05-14, at 21:06, Peter Kämpf wrote:

> The errors occur in /Developer/SDKs/MacOSX10.5.sdk/usr/include/
> tclPlatDecls.h and look like this. The corresponding line looks  
> quite innocent to me:

> /Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:106: error:
> syntax error before 'OSType'

> Could please someone give me a hint what is happening here?

For OSType, I think the problem is in tclMacOSXFCmd.c. So I use this:

#ifndef __MACTYPES__
typedef u_int32_t OSType;
#endif


Philip Aker
echo astwta@...@nl | tr a-z@. p-za-o.@

Sent from my SE/30


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: Tcl 8.5 and Xcode 3.0

by Peter Kämpf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Philip,

thanks for helping! Please excuse my ignorance; I did not know how to  
apply your hint and put it in my main.c file. This was the result:





The same happens when I add the definition to tclPlatDecls.h at line #  
33. This was the result:

Building target “EntwurfLib” of project “EntwurfLib” with  
configuration “Release” — (17 errors)
            cd /Users/Peter/Mac-Version/Fortran/EntwurfLib
     /Developer/usr/bin/gcc-4.0 -x c -arch i386 -pipe -Wno-trigraphs -
fpascal-strings -fasm-blocks -Os -Wreturn-type -Wunused-variable -
fmessage-length=0 -mmacosx-version-min=10.5 -gdwarf-2 -I/Users/Peter/
Mac-Version/Fortran/EntwurfLib/build/EntwurfLib.build/Release/
EntwurfLib.build/EntwurfLib.hmap -F/Users/Peter/Mac-Version/Fortran/
EntwurfLib/build/Release -I/Users/Peter/Mac-Version/Fortran/EntwurfLib/
build/Release/include -I/Users/Peter/Mac-Version/Fortran/EntwurfLib/
build/EntwurfLib.build/Release/EntwurfLib.build/DerivedSources -
isysroot /Developer/SDKs/MacOSX10.5.sdk -c /Users/Peter/Mac-Version/
Fortran/EntwurfLib/../main.c -o /Users/Peter/Mac-Version/Fortran/
EntwurfLib/build/EntwurfLib.build/Release/EntwurfLib.build/Objects-
normal/i386/main.o
In file included from /Users/Peter/Mac-Version/Fortran/EntwurfLib/../
Tcl.h:2248,
                  from /Users/Peter/Mac-Version/Fortran/EntwurfLib/../
main.c:12:
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:34: error:  
syntax error before 'OSType'
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:53: error:  
syntax error before 'procPtr'
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:56: error:  
syntax error before 'resource'
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:63: error:  
syntax error before 'Tcl_MacFindResource'
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:68: error:  
syntax error before 'OSType'
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:72: error:  
syntax error before 'OSType'
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:75: error:  
syntax error before 'osType'
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:106: error:  
syntax error before 'procPtr'
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:107: error:  
syntax error before 'resource'
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:109: error:  
syntax error before 'Handle'
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:110: error:  
syntax error before 'OSType'
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:111: error:  
syntax error before 'OSType'
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:112: error:  
syntax error before 'osType'
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:113: error:  
'strncasecmp' redeclared as different kind of symbol
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:77: error:  
previous declaration of 'strncasecmp' was here
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:114: error:  
'strcasecmp' redeclared as different kind of symbol
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:80: error:  
previous declaration of 'strcasecmp' was here
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:120: error:  
syntax error before '}' token
/Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:125: error:  
syntax error before '*' token
                                 from /Users/Peter/Mac-Version/Fortran/EntwurfLib/../
main.c:12:
                        In file included from /Users/Peter/Mac-Version/Fortran/
EntwurfLib/../Tcl.h:2248,
                                /Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:34:  
error: syntax error before 'OSType'


I have no idea where I would find tclMacOSXFCmd.c; probably I was  
supposed to add the definition there. But how?

Your SE/30 is still working? The video card of my SE/30 died in the  
early nineties, but I still keep it for it's sentimental value ...

Best Regards,

Peter

Am 15.05.2008 um 06:50 schrieb Philip Aker:

> On 08-05-14, at 21:06, Peter Kämpf wrote:
>
>> The errors occur in /Developer/SDKs/MacOSX10.5.sdk/usr/include/
>> tclPlatDecls.h and look like this. The corresponding line looks  
>> quite innocent to me:
>
>> /Developer/SDKs/MacOSX10.5.sdk/usr/include/tclPlatDecls.h:106: error:
>> syntax error before 'OSType'
>
>> Could please someone give me a hint what is happening here?
>
> For OSType, I think the problem is in tclMacOSXFCmd.c. So I use this:
>
> #ifndef __MACTYPES__
> typedef u_int32_t OSType;
> #endif
>
>
> Philip Aker
> echo astwta@...@nl | tr a-z@. p-za-o.@
>
> Sent from my SE/30
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Bild 3.png (55K) Download Attachment

Re: Tcl 8.5 and Xcode 3.0

by Philip Aker-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 08-05-17, at 22:35, Peter Kämpf wrote:

> thanks for helping! Please excuse my ignorance; I did not know how  
> to apply your hint and put it in my main.c file. This was the result:

I see our build situations are different.  I apply that change when  
building the Tcl.framework sources in Xcode.  Then I insert it into  
tclMacOSXFCmd.c because OSType as defined for Mac is UInt32 and  
depending on how tight the compiler options are set, it will flag what  
it sees as a conflicting re-definition.

According to the pictures you sent you are compiling some arbitrary C  
code on 10.5, using the 10.5 SDK and possibly targeting 'compiler  
default'. When I compile arbitrary code like that, I don't have a  
similar problem and don't even have to think about things like the  
work-a-round I sent.

So I am going to send you a tiny project off-list which compiles  
without complaint for 10.5. It has reasonably strict gcc options and  
includes all the Carbon frameworks. Hopefully it can illustrate that  
you shouldn't be getting those types of errors. Maybe you can adapt  
from it?


> Your SE/30 is still working? The video card of my SE/30 died in the  
> early nineties, but I still keep it for it's sentimental value ...

One of them still is but my sig is remarking the fact that there are  
no legal iPhones in Canada just yet. Otherwise I might be using: "Sent  
from my iPhone".

Philip Aker
echo astwta@...@nl | tr a-z@. p-za-o.@

Sent from my SE/30


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac
LightInTheBox - Buy quality products at wholesale price