Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / September 2004



Tip: Looking for answers? Try searching our database.

MPW & carbon - linker problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Markus Zingg - 02 Sep 2004 16:26 GMT
Hi all

I'm trying to compile my first carbon program on a iMac using OS9 and
MPW. The code compiles, but the linker complains about unresolved
external references and lists - not really surprizingly - all carbon
API calls I use.

I can compile and run programs using older API's just fine but this is
no option in that the resulting program must run on OS9 and OSX.

How on earth do I teach MPW to link with the carbon library? I'm a
complete newbe when it comes to Mac programing, and I'm currently
bound to using this iMac and OS9. I'm also trying things for quite a
while to no avail... Any help is greatly apreciated!

TIA

Markus
Tommy - 09 Sep 2004 09:12 GMT
These are the libraries I am linking with:
"{PPCLibraries}"CarbonStdCLib.o, "{PPCLibraries}"StdCRuntime.o,
"{PPCLibraries}"PPCCRuntime.o, "{SharedLibraries}"CarbonLib and
"{SharedLibraries}"StdCLib.
Thomas Engelmeier - 09 Sep 2004 11:55 GMT
> These are the libraries I am linking with:
> "{PPCLibraries}"CarbonStdCLib.o,
> "{PPCLibraries}"StdCRuntime.o,
> "{PPCLibraries}"PPCCRuntime.o,
> "{SharedLibraries}"CarbonLib and
> "{SharedLibraries}"StdCLib.

Two runtimes and two StdCLib variants are too much.

You need:
- one runtime (for PPC, StdC was IIRC to produce MPW tools)
- one libaray to access the MacOS routines (CarbonLib)
- one Standard library (only if you use standard C functions like
printf, strcmp et al.)

Signature

This address is valid in its unmodified form but expires soon.

Toby Thain - 13 Sep 2004 05:02 GMT
> Hi all
>
> I'm trying to compile my first carbon program on a iMac using OS9 and
> MPW. ... How on earth do I teach MPW to link with the carbon library? ...

This set of libraries works for me:
        "{PPCLibraries}StdCRuntime.o"
        "{PPCLibraries}PPCCRuntime.o"
        "{SharedLibraries}CarbonLib"
        "{SharedLibraries}StdCLib"

You could also refer to the Makefiles in the sample code included with
the Carbon SDK (via http://developer.apple.com/sdk/). Some of those
link with {SharedLibraries}CarbonLib alone.

For more information:
1. http://developer.apple.com/documentation/Carbon/Conceptual/carbon_porting_guide/
cpg_buildstruct/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000991-CH203-TP
XREF107

2. http://developer.apple.com/documentation/Carbon/Conceptual/carbon_porting_guide/
cpg_buildstruct/chapter_3_section_7.html


--Toby

> TIA
>
> Markus
Toby Thain - 29 Sep 2004 18:01 GMT
> > Hi all
> >
[quoted text clipped - 6 lines]
>         "{SharedLibraries}CarbonLib"
>         "{SharedLibraries}StdCLib"

In a project using StdCLib, you must use the following libraries and
objects, in the following order, or your application will not launch
under Carbon (may not properly bind to the OS X StdCLib):

        "{PPCLibraries}CarbonStdCLib.o" ?
        "{PPCLibraries}StdCRuntime.o" ?
        "{PPCLibraries}PPCCRuntime.o" ?
        "{SharedLibraries}CarbonLib" ?
        "{SharedLibraries}StdCLib"

--Toby

> For more information:
> 1. http://developer.apple.com/documentation/Carbon/Conceptual/carbon_porting_guide/
cpg_buildstruct/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000991-CH203-TP
XREF107

[quoted text clipped - 5 lines]
> >
> > Markus
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.