header files missing

I’ve been trying to write a program in c++, but I can’t find the path to the header files to tell the compiler to include the path. I’m on OSX mountain lion, and I’ve tried reinstalling panda 1.8.1 multiple times, making sure to check the ‘include header files’ checkbox. I’ve been looking in /Applications/Panda3D/1.8.1/include. What am I missing?

They should be in /Developer/Panda3D/include .

Ok. I tried:
gcc -I /Developer/Panda3D/include main.cpp
Which raised:
fatal error: ‘pyconfig.h’ file not found
So, after some digging, I tried:
gcc -I /Developer/Panda3D/include -I /usr/include/Python2.5 main.cpp
Which raised:
ld: symbol(s) not found for architecture x86_64
I’m pulling my hair out here. What am I missing?

1.8.1 is 32-bit only. Add “-arch i386” to your command.

Ok. I tried:
gcc -I /Developer/Panda3D/include -I /usr/include/Python2.5 -arch i386 main.cpp
Which raised:
invalid lvalue in asm input for constraint ‘m’
It seems this error happens to people on OSX that try to compile with the -arch i386 flag. Is there any way to install two versions of panda, one 1.8 and one 1.7, so that i can use the 1.8 one with python and the 1.7 one with c++ so that I can avoid the -arch i386 flag? I rely on the new features in 1.8 in some of my python programs, so going back to 1.7 for that is not an option.

You could also grab this experimental 64-bit build:

rdb.name/Panda3D-1.9.0.dmg
It fixes a lot of the issues in more recent versions of OS X. Note: it’s compiled with Python 2.7.

That would be perfect, because I wanted to use panda3d with pyserial, and pyserial doesn’t like python 2.5. But when I tried to install the experimental build, it says that there were errors with the installation, and that the installation failed. I tried uninstalling the previous version of panda and tried again, but it reported the same error. What could have caused this problem?

I’m not sure. What kind of error do you get?

Sorry for taking so long to reply. Here was the log:

Oct 11 17:17:40 Parkers-MacBook-Pro.local installd[1111]: PackageKit: ----- Begin install -----
Oct 11 17:17:51 Parkers-MacBook-Pro.local installd[1111]: PackageKit: *** launch path not accessible
Oct 11 17:17:51 Parkers-MacBook-Pro.local installd[1111]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=112 "An error occurred while running scripts from the package “base.pkg”." UserInfo=0x7fb389a867b0 {NSFilePath=./postflight, NSURL=file://localhost/Volumes/Panda3D/Panda3D.mpkg/Contents/Packages/base.pkg, PKInstallPackageIdentifier=org.panda3d.panda3d.base.pkg, NSLocalizedDescription=An error occurred while running scripts from the package “base.pkg”.} {
	    NSFilePath = "./postflight";
	    NSLocalizedDescription = "An error occurred while running scripts from the package \U201cbase.pkg\U201d.";
	    NSURL = "file://localhost/Volumes/Panda3D/Panda3D.mpkg/Contents/Packages/base.pkg";
	    PKInstallPackageIdentifier = "org.panda3d.panda3d.base.pkg";
	}
Oct 11 17:17:51 Parkers-MacBook-Pro.local Installer[24012]: Install failed: The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
Oct 11 17:17:51 Parkers-MacBook-Pro.local Installer[24012]: Displaying 'Install Failed' UI.
Oct 11 17:17:51 Parkers-MacBook-Pro.local Installer[24012]: 'Install Failed' UI displayed message:'The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.'.

That was all the information available. I don’t know if any of this is helpful, but just in case it is.

Not that much, sadly. It tells us that the postflight script failed, but it doesn’t give the exact error.

I’ve recently upgraded my mac to Mavericks so I might be able to look into the Mac build again soon.

(If you haven’t already, please vote for this poll if you can.)

Is there any way to use c++ with panda3d in the meantime? It would be okay if some of my python projects no longer worked as long as I could try out c++ for a while.

Ok, I installed parallels, windows, python, panda3d and visual studio express 2013.
I then followed the guide in the manual for getting a basic hello world example working on visual studio 2008.
I managed to figure out the first few problems, but upon running the first example the program cannot continue because of the following error:

Unhandled exception at 0x68F0CAD3 (msvcr120.dll) in HelloWorld.exe: 0xC0000005: Access violation writing location 0x5802B305.

I am brought to a screen that reports that msvcr120.i386.pdb is not loaded.
it suggests to change existing PDB and binary search paths.

Unfortunately, due to Microsoft’s compiler design, you have to use MSVC 2008 if Panda is compiled with MSVC 2008.

Alternatively, you can use a development build of Panda3D and use MSVC 2010, which I would recommend. You may need the Windows 7.1 SDK to get the 64-bit compilers.

Oh, I made a few more 64-bit mac builds. Maybe you’d have more luck with it. I haven’t tested it, though.

rdb.name/Panda3D-1.9.0-osx10.6-py2.6.dmg
rdb.name/Panda3D-1.9.0-osx10.7-py2.7.dmg

Sorry for the late reply.
I get the same ‘installation failed’ error with the second link you posted.
The first link installs fine. Python works okay with it too, but when i try running c++ with it, I get an error:

Undefined symbols for architecture x86_64:
  "TypedObject::_type_handle", referenced from:
      TypedObject::get_class_type() in main-b81b3b.o
  "TypedObject::init_type()", referenced from:
      Socket_IP::init_type() in main-b81b3b.o
  "TypedObject::~TypedObject()", referenced from:
      Socket_IP::~Socket_IP() in main-b81b3b.o
  "TypeRegistry::register_type(TypeHandle&, std::string const&)", referenced from:
      register_type(TypeHandle&, std::string const&, TypeHandle) in main-b81b3b.o
  "TypeRegistry::record_derivation(TypeHandle, TypeHandle)", referenced from:
      register_type(TypeHandle&, std::string const&, TypeHandle) in main-b81b3b.o
  "TypeRegistry::ptr()", referenced from:
      register_type(TypeHandle&, std::string const&, TypeHandle) in main-b81b3b.o
  "PandaFramework::open_window()", referenced from:
      _main in main-b81b3b.o
  "PandaFramework::open_framework(int&, char**&)", referenced from:
      _main in main-b81b3b.o
  "PandaFramework::close_framework()", referenced from:
      _main in main-b81b3b.o
  "PandaFramework::main_loop()", referenced from:
      _main in main-b81b3b.o
  "PandaFramework::PandaFramework()", referenced from:
      ___cxx_global_var_init3 in main-b81b3b.o
  "PandaFramework::~PandaFramework()", referenced from:
      ___cxx_global_var_init3 in main-b81b3b.o
  "WindowFramework::enable_keyboard()", referenced from:
      _main in main-b81b3b.o
  "WindowFramework::setup_trackball()", referenced from:
      _main in main-b81b3b.o
  "Notify::assert_failure(char const*, int, char const*)", referenced from:
      BitMask<unsigned int, 32>::set_bit(int) in main-b81b3b.o
  "Notify::out()", referenced from:
      _main in main-b81b3b.o
  "Notify::ptr()", referenced from:
      BitMask<unsigned int, 32>::set_bit(int) in main-b81b3b.o
  "Socket_IP::_type_handle", referenced from:
      Socket_IP::init_type() in main-b81b3b.o
      Socket_IP::get_class_type() in main-b81b3b.o
  "typeinfo for TypedObject", referenced from:
      typeinfo for Socket_IP in main-b81b3b.o
  "_memory_hook", referenced from:
      MemoryBase::operator delete(void*) in main-b81b3b.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

With visual studio 2008, windows SDK 7.1 and panda3d 1.8.1, compiling gives me the following error:

1>------ Build started: Project: pandapride, Configuration: Release Win32 ------
1>Linking...
1>Generating code
1>c:\Users\jlawrence\Documents\Visual Studio 2008\Projects\pandapride\pandapride\main.cpp : fatal error C1001: An internal error has occurred in the compiler.
1>(compiler file 'f:\dd\vctools\compiler\utc\src\p2\reader.c', line 3850)
1> To work around this problem, try simplifying or changing the program near the locations listed above.
1>Please choose the Technical Support command on the Visual C++ 
1> Help menu, or open the Technical Support help file for more information
1>LINK : fatal error LNK1257: code generation failed
1>Build log was saved at "file://c:\Users\jlawrence\Documents\Visual Studio 2008\Projects\pandapride\pandapride\Release\BuildLog.htm"
1>pandapride - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Hmm, which libraries are you linking with? Perhaps the 10.6 build is actually 32-bit instead of 64-bit? If so, try adding -arch i386 to your command-line.

As for the MSVC 2008 error, try installing Service Pack 1 of Visual Studio 2008.

I can’t get service pack 1 because it requires a professional or ultimate version of visual studio 2008, and I only have express.
-arch i386 flag with panda 1.9.0 raises this error:

In file included from main.cpp:2:
In file included from /Developer/Panda3D/include/pandaFramework.h:20:
In file included from /Developer/Panda3D/include/windowFramework.h:19:
In file included from /Developer/Panda3D/include/nodePath.h:23:
In file included from /Developer/Panda3D/include/pandaNode.h:20:
In file included from /Developer/Panda3D/include/cycleData.h:19:
In file included from /Developer/Panda3D/include/typeHandle.h:19:
In file included from /Developer/Panda3D/include/typeRegistry.h:20:
In file included from /Developer/Panda3D/include/memoryBase.h:19:
In file included from /Developer/Panda3D/include/memoryHook.h:20:
In file included from /Developer/Panda3D/include/atomicAdjust.h:31:
In file included from /Developer/Panda3D/include/atomicAdjustI386Impl.h:56:
/Developer/Panda3D/include/atomicAdjustI386Impl.I:35:30: error: invalid lvalue in asm input for constraint 'm'
                       :"m" (&var));
                             ^~~~
/Developer/Panda3D/include/atomicAdjustI386Impl.I:62:30: error: invalid lvalue in asm input for constraint 'm'
                       :"m" (&var) : "memory");
                             ^~~~
2 errors generated.

I just double-checked and the 10.6 build really is 64-bit. So I’m guessing that the errors are because you’re not linking against the right libraries (again, which are you linking with?) or Panda3D didn’t install properly and you’re accidentally compiling against outdated libraries.

I didn’t think the service pack was for the full version only (I recall using it in the past), but I could be wrong.

I finally got it to work!
I used the following commands with Panda3D-1.9.0-osx10.6-py2.6.dmg installed:

g++ -c main.cpp -o main.o -fPIC -O2 -I /usr/include/Python2.5 -I /Developer/Panda3D/include
g++ main.o -o main -fPIC -L /Developer/Panda3D/lib -lp3framework -lpanda -lpandafx -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3direct -framework Python
./main

Great! Although it’s compiled with Python 2.6, so you’d have to change the include dir to /usr/include/python2.6, but I guess that doesn’t harm all that much.