Getting started on Mac (preferably in XCode)

So I’m using c++ on a Mac, and I’m trying to make something really basic at this point to start using Panda 3D, but it doesn’t work out of the box (there isn’t a framework as far as I can tell), and I can’t seem to find any sort of documentation on getting started with this.

Is there an XCode template?
Do I have to do some sort of special-compilation to get a Framework for Panda3D?
Is there documentation for starting a project from scratch in C++?

Thanks. Sorry if I’m a bit fuzzy right now: it’s REALLY late because I’ve been spending the past few hours trying to figure this out on my own. I’m guessing I’ve missed something that wasn’t well titled or doesn’t come up on Google for whatever reason…

I don’t think anyone’s built an XCode template yet, but such a thing should be easy to do. If you’d like to be the one, I’m sure other developers would appreciate it.

All you need to do is create a project that has the path to the .h files, and that links with the .dylib files. On Windows, there is more fussing you have to do (you have to be sure to use the right version of the compiler, and the right Release/Debug/NDEBUG settings). On Mac, these aren’t as important (but you don’t want to enable a full-production build with NDEBUG automatically enabled).

Note, a “Framework” is an Apple-specific concept; Panda doesn’t build one, as it’s designed to be cross-platform. XCode can work perfectly well without a framework, it just means you name the files you need explicitly.


No Framework? Ouch… I thought this had Mac support… I guess this is gonna be ALOT harder…

So I’m trying to get it to work now, and I’m still a bit confused: there doesn’t seem to be any straight-foreward .h for me to include to make it work… Or at least I can’t figure out which one I need to link…

Why isn’t there any documentation on this? The rest of it looks so well documented, but this is a really big gap in the docs…

My team is using Unity right now though, but I’d REALLY like to free up the option of using a REAL game-engine like Panda, so I’m trying to just program a simple program with it to show that it works, but I can’t even do that…

Has ANYONE gotten this to build on Mac at all even? I’m actually questioning that now, since the only thing I’ve been able to find from searches is unresolved error threads…

I do most of my primary development on a Mac. I’m on a Mac right now. It builds just fine here. Have you never built any code on a Mac outside of a Framework? Why do you think that’s difficult?

There is not a single .h file to include, of course. You should include the appropriate .h files that define the classes that you are using. The .h files aren’t related to the link step, though; for linking, you reference the appropriate library files.

What additional documentation would you like to see?


I dunno, I’m just used to it being alot simpler than this. No, I haven’t done anything like this on a Mac without a framework, I didn’t even know that it was acceptable to release something like this without one…

Do you go through any specific process to get it to start up? I tried adding all the files from Panda/include to the project, but none of that worked. Maybe you can set up an X-Code template and toss it up somewhere for others to use? That would probably make Mac-development ALOT easier…

I’m just really used to having enough documentation to step me through the initial process of getting things up and running so I can start making a simple program with this stuff, seeing as that’s really the hardest part of it all…

To be honest, it just never occurred to me that we ought to release Panda as a framework. Coming from a non-Mac background, I always found the whole framework system to be a bit of a nuisance; it separates the developer from the code he is trying to use and makes it harder to understand what the compiler is actually doing. But now that you bring it up, I can see my mistake: for people who have been used to the Mac way of doing things, it’s weird to have libraries not in a framework. So, it’s probably a good idea for us to figure out how to package Panda in a framework for future releases.

Still, a framework really only provides two pieces of information:
(1) The path to the .h files.
(2) The set of libraries that should be linked with.

You can add these directly to your Xcode project. I’m not an Xcode user myself, so I can’t tell you precisely where they should go, but it shouldn’t be too hard to find.

You don’t need to add the .h files themselves. There should be an “include path” setting somewhere that tells the compiler to go search this directory whenever a .h file is referenced. That’s what a framework sets implicitly.


K, so doing that I’ve gotten it to see and use the library, but I’ve hit one last bug. There is a class called “TextFont” which Panda is trying to use but is never defined, so I have 39 errors involving TextFont not existing. Have you seen this before? How is it fixed?

I’d need to see the precise error messages, especially the first error message, to know what’s going on.

There are a couple of possibilities. One is that the Freetype library isn’t available on your system (this library is needed to implement TextFont), but some part of Panda was compiled with the belief that it is available for some reason. Another possibility is that textFont.h simply needs to be included first before whatever else it is that you’re including. (Occasionally you will find a Panda header file doesn’t properly include all of the header files that it itself depends on. This is a fairly common problem, because errors of this nature cannot be detected when Panda itself is compiled; it can only be detected when someone externally includes a particular Panda header file directly. When this happens, the workaround is to include the required header files yourself, before including the broken one; the long-term fix is to add the required reference to Panda’s header file.)