Skip to main content
Adobe Photoshop Family

7 Messages

 • 

160 Points

Tue, Aug 2, 2011 9:47 PM

Solved

Photoshop SDK: CS5- problems compiling sample code

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.

Responses

15.1K Messages

 • 

195.8K Points

9 years ago

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.

7 Messages

 • 

160 Points

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.

15.1K Messages

 • 

195.8K Points

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.

7 Messages

 • 

160 Points

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....

15.1K Messages

 • 

195.8K Points

Someone seriously expects you to do development on a system without administrative access? Wow.

7 Messages

 • 

160 Points

9 years ago

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.

15.1K Messages

 • 

195.8K Points

Types.r is an OS SDK header, part of the Carbon toolbox, and should be found automatically by the IDE.

7 Messages

 • 

160 Points

9 years ago

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.

15.1K Messages

 • 

195.8K Points

That's a compiler or OS supplied macro. It's optional and doesn't have to be defined.

7 Messages

 • 

160 Points

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 :)