0

I'm toying around with development on Mac OS 9 using Macintosh Programmers Workshop. I notice in the CImports folder there is a CFString.h with our beloved Core Foundation string.

I've managed to build and run a stdio-based hello world, but when I try to use CFString functions such as CFSTR("my string") or CFStringGetLength(myStr) this results in a linker error.

How do I configure MPW to find the correct libraries for linking? Also, are there resources out there for a developer who knows C but has never approached MPW?

I've reached this point by following this tutorial: https://sites.google.com/site/chuzzum/macintosh-c-programming-guide/macintosh-development-environments/getting-started-with-mpw

wjl
  • 7,143
  • 1
  • 30
  • 49

1 Answers1

0

It's been ages since I last tinkered with MPW, but the gist is that you need to link against CarbonLib.

I hope you've already discovered the option-enter shortcut for running commands through Commando. That makes things a lot easier.

Peter Hosey
  • 95,783
  • 15
  • 211
  • 370
  • Using a SIOW type app restricts to Classic. I compared make files and was able to link CarbonLib but at runtime it alerted that CarbonLib could not be found. I just decided to dump SIOW since it seems to dump stdout and Foundation to log flies anyhow. Thanks! – wjl Feb 04 '13 at 08:39
  • Culd you elaborate on the shortcut? – wjl Feb 04 '13 at 08:39
  • @wjlafrance: What do you mean by “restricts to Classic”? SIOW shouldn't require the Mac OS X Classic Environment, as it pre-dates Mac OS X (and fills in for the UNIX stdio system, which Mac OS obviously doesn't have). CarbonLib up to 1.6 runs just fine on Mac OS 9, with or without the Classic Environment. – Peter Hosey Feb 05 '13 at 00:02
  • @wjlafrance: If you press option-enter instead of enter (I don't remember whether these worked with return as well), MPW will try to run the command through Commando, which will present a GUI for the command. – Peter Hosey Feb 05 '13 at 00:03
  • @wjlafrance: Make sure you have the user-level CarbonLib installed in your Extensions folder. You can get version 1.6 from Apple's kbase: http://support.apple.com/kb/DL1116?viewlocale=en_US – Peter Hosey Feb 05 '13 at 00:08
  • Sorry, when you're choosing what to target with your app (I don't remember the technical term), you can choose "Classic" or "Carbon", but for SIOW you can not build against Carbon. I decided to forego SIOW anyhow since it's not my end goal. – wjl Feb 07 '13 at 00:33