Error building from makepanda.py on Mac

I’ve been attempting to build Panda from source to work with a Python 2.7 distro on my Mac (OSX 10.8 ), but keep running into an error at 48%:

[ 48%] Building C++ object built/tmp/p3osxdisplay_composite1.o
g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/p3osxdisplay_composite1.o -Ibuilt/tmp -Ibuilt/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/X11R6/include -DMAKEPANDA= -Ipanda/src/osxdisplay -Wno-deprecated-declarations -arch i386 -pthread -msse2 -O2 -DBUILDING_PANDAGL panda/src/osxdisplay/p3osxdisplay_composite1.cxx
In file included from panda/src/osxdisplay/p3osxdisplay_composite1.cxx:4:
panda/src/osxdisplay/osxGraphicsStateGuardian.cxx: In member function ‘OSStatus osxGraphicsStateGuardian::build_gl(bool, bool, FrameBufferProperties&)’:
panda/src/osxdisplay/osxGraphicsStateGuardian.cxx:191: error: ‘GetMainDevice’ was not declared in this scope
Process exited with exit status 1 and signal code 0

From this forum I’ve seen a couple other people run into this problem, but this was because they were building for 64-bit Python, and seemed to be fixed when forcing into 32-bit (Panda3D requires Carbon, which isn’t 64-bit). However, I’m installing using a 32-bit Python, and g++ should be using a 32-bit architecture (note the ‘-arch i386’) yet I’m still getting this error. Does anyone know why this error might still be popping up, or how to fix it so I can get Panda installed?

Thanks!

Hmm. Maybe try --osxtarget=10.4 or something like that? Do you perhaps have to explicitly install the Carbon framework (even the 32-bit version) on Lion?

David

In general, the rule has always been that makepanda will build for the version of Python that you’re running it with. So, if you want to build for 32-bits Python, you’ll need to run makepanda.py with a 32-bits copy of Python; if it is a universal copy, you’ll need to force it into 32-bits mode.

There is 64-bit OS X and Cocoa support on the CVS trunk, so if you check out from the CVS repository, you should be able to produce a Cocoa build if you prefer.

If you wish to make a 64-bit build, you’ll need new thirdparty packages; I built a few, but not all are present.
rdb.name/thirdparty_mac_x86_64.tar.bz2

If you wish to make a 32-bit build with the latest CVS trunk, you can use the “–arch i386” flag, which was recently added to makepanda. You can build with --no-cocoa to get a Carbon-only build if you wish, but the new Cocoa renderer should of course still work with a 32-bit build.