Photoshop SDK: CS5- problems compiling sample code

  • 1
  • Problem
  • Updated 7 years ago
  • Solved
  • (Edited)
I'm working on a project to create plugins for Photoshop CS5 on a Mac, 64-bit only. This is for in-house use only, not something that has to be slick or perfect. So far, I haven't been able to get anything to compile. Sample code for a simple do-nothing plugin, format or filter types especially, would be a tremendous help. The SDK's samples won't compile, and involve a lot of extraneous material. I'm not sure what applies to CS5 vs. older versions. Some seem to use header files that don't exist.

Beyond sample source code, is there a way to get one-on-one help from someone who knows their way around plugin programming? I'm new to Mac programming and may have many more naive questions (and sometimes do not know that I should ask a naive question) and with luck some intelligent sophisticated questions.
Photo of Daren Wilson

Daren Wilson

  • 7 Posts
  • 1 Reply Like

Posted 7 years ago

  • 1
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 769 Reply Likes
The SDK examples all compile on Macintosh and Windows. Both platforms are probably one major revision of the compiler behind the current versions, though (because CS5 was released a year and a half ago). If you're on the absolute latest compilers/IDEs you will have to update the projects and maybe a few headers.

The SDK has documentation on mailing lists and contacts for the plugin SDK.
Or you can ask questions in the SDK section of the user forums.
Photo of Daren Wilson

Daren Wilson

  • 7 Posts
  • 1 Reply Like
I'm using xcode 3.2.3, Photoshop SDK for CS5 has most files dated April 2010, and running on OS X 10.6.4.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 769 Reply Likes
The current XCode version is 3.2.6 (well, techically 4.0 is out if you like beta testing and debugging IDEs). And the OS should be 10.6.8. It sounds like you haven't installed updates in over a year.
Photo of Daren Wilson

Daren Wilson

  • 7 Posts
  • 1 Reply Like
It's a company computer and I don't have root login access. The guy in charge of such things will be pestered...when he's back from vacation....
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 769 Reply Likes
Someone seriously expects you to do development on a system without administrative access? Wow.
Photo of Daren Wilson

Daren Wilson

  • 7 Posts
  • 1 Reply Like
One little thing I wonder about... in the SimpleFormat sample code, one of the .r files has a line to #include Types.r. I don't see Types.r in the sample code or in the Photoshop SDK - so where is it?

This is just one example of a little mystery that's not quite worthy of its own question on a forum, but I wish there was an experienced Mac programmer in the next cubicle to answer.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 768 Reply Likes
Types.r is an OS SDK header, part of the Carbon toolbox, and should be found automatically by the IDE.
Photo of Daren Wilson

Daren Wilson

  • 7 Posts
  • 1 Reply Like
And where is PRAGMA_ONCE supposed to be defined? My attempts to make a plugin fail with an undefined variable PRAGMA_ONCE in PIResDefines.h, and I see many "#if PRAGMA_ONCE" in the SDK, but nowhere do I see how it is defined.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 768 Reply Likes
That's a compiler or OS supplied macro. It's optional and doesn't have to be defined.
Photo of Daren Wilson

Daren Wilson

  • 7 Posts
  • 1 Reply Like
With #if not #ifdef, it looks like it does have to be defined. So I stuck a #define in my experimental project, setting it to zero as a guess. Now it compiles :)