I can build this sample on x86/64 on Mac OS X 10.8.
This is what “g++ --version” reports on my system:
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Can you check your system? Looks like it is picking a different compiler.
Ok, it seems the problem is related to having the Macports g++ installed:
$ g++ --version
g++ (MacPorts gcc45 4.5.4_7) 4.5.4
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Keeping the Macports g++ installed is important to me - is there a way to temporarily switch back to the system version to build the examples?
XCode is “Version 4.6.3 (4H1503)” (not beta).
Speaking of XCode, I’d prefer to build the examples in XCode rather than from the command line - is there a way to do that?
The command to see the list of installed versions is port select --list gcc.
The examples are compiling now, and it looks like there are no problems. It would still be nice to know if there’s a way to build them from within XCode.