Just a follow up. I got this to work. Two modifications were necessary
- You must build panda3d first using the makepanda.py script. This creates all the libraries you need for any work you are doing. Here is the command I used:
makepanda.py --everything --no-fmod --optimize=1
I have this set up in VSCode as a configuration like this:
{
"name": "Build Panda3D",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/makepanda/makepanda.py",
"console": "integratedTerminal",
"args": [
"--everything",
"--no-fmod",
"--optimize=1"
]
}
The command failed at 48% due to a clang++ bug with Xcode 13. I had to downgrade my Xcode to 12.5 to fix it.
- You need to link a string of libraries when you build any C++ file for panda3d. Here is the command that worked for me:
/usr/bin/clang++ -g /Users/paustian/Documents/ComputingProjects/panda3d/pandatool/src/bam/bamInfo.cxx -std=c++11 -I /Users/paustian/Documents/ComputingProjects/panda3d/built/include -L /Users/paustian/Documents/ComputingProjects/panda3d/built/lib -lp3framework -lpanda -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3direct -lp3eggbase -lp3progbase -lp3converter -lp3pandatoolbase -lpandaegg -v -o /Users/paustian/Documents/ComputingProjects/panda3d/built/bin/bamInfo
In addition, it took me a bit to notice that the library name was different than the option in the command (lib3progbase vs -l3progbase). It is convenient to set up a Build Task in VSCode (this goes in tasks.json):
{
"type": "cppbuild",
"label": "C/C++: clang++ build active file",
"command": "/usr/bin/clang++",
"args": [
"-g",
"${file}",
"-std=c++11",
"-I",
"/Users/paustian/Documents/ComputingProjects/panda3d/built/include",
"-L",
"/Users/paustian/Documents/ComputingProjects/panda3d/built/lib",
"-lp3framework",
"-lpanda",
"-lpandaexpress",
"-lp3dtoolconfig",
"-lp3dtool",
"-lp3direct",
"-lp3eggbase",
"-lp3progbase",
"-lp3converter",
"-lp3pandatoolbase",
"-lpandaegg",
"-v",
"-o",
"/Users/paustian/Documents/ComputingProjects/panda3d/built/bin/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "compiler: /usr/bin/clang++"
}