No debug in Panda3d for c++ ?

Hello Forum ,
this is my first entry here (and sorry if I start with a minor rant :blush: )

How come I can’t compile a debug version of my Panda3D program ?

With a release only version I can’t get a proper callstack.

Also is there any plans from the authors to remove the “warnings” that come up when the source gets compiled ? (something about STL compatibility issues of some panda objects, not my code but part of the SDK )

I have downloaded and installed panda just about 2-3 days ago and so far I must say its excellent work by the Panda team :smiley:

I can get a proper callstack in release. By default visual studio builds with symbols in release too. Have you checked?

Also you could build Panda in debug if you want to use the debug runtime of visual studio with it. But I’ve found I don’t need this to debug Panda.

Hi there and thanks for your answer so far :slight_smile:

“Also you could build Panda in debug if you want to use the debug runtime of visual studio with it. But I’ve found I don’t need this to debug Panda.”

By this you mean download from CVS the full source of panda right ? (I currently only have the “out of the box” version installed)

In the manual it also describes that it cannot be compiled in debug because of “instablity” (?), further if I try to compile in debug it tells me that panda_d.lib (or similar, I am not at my computer at the moment), is missing. So to me it looks like the installation package does not contain a debug version of panda.

Some stuff in the manual is very old. The panda official binaries come prebuilt in release. That’s the only limitation. But building Panda in debug should work, though I never do that, because release with symbols is enough for me, so it’s possible there are some problems, I wouldn’t know.

Also you don’t need CVS to build panda, you can just get the source package.

I still don’t understand why you can’t get a named callstack, I think our release build comes with symbols, though I might be wrong because I always build from CVS. Are there pdb files in the bin directory?

I can’t check right now because I am writing fom my work computer :slight_smile:

I will have a go tonight when I am home.

Could you post me here a link to the full source of Panda ? (not using CVS at home)
All I can see is the SDK download http://www.panda3d.org/download.php?sdk

[EDIT] I think I found it http://www.panda3d.org/download.php?platform=other&version=1.7.0&sdk [/EDIT]

I seem to not be the only one who struggles to get panda running in a debug build.

https://discourse.panda3d.org/viewtopic.php?t=6906&postdays=0&postorder=asc&start=0

Is there some updates on this matter ?

the makepanda.bat seems a bit screwed when i try and use it.

I downloaded the http://152.10.254.215/~pro-rsoft/win-python-dbg.zip mentioned in the other forum thread. Which gives me a debug version of python.

I run run with following cmd line

makepanda\makepanda.bat --everything --verbose --optimize 1 --outputdir debug

it comes up with an error “Cannot find rc.exe on serch path”

[EDIT]
RC.exe is present on my computer under
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin
[/EDIT]

any idas ?

Run makepanda from the Visual Studio console.

Could you elaborate please ? :slight_smile:

[EDIT]
Actually I will do for the sake of completeness for other users :slight_smile:

[\EDIT]

In your start menu, find “Visual Studio 2008 Command Prompt”. It may also be under the Tools menu in Visual Studio itself.

Here is how I have done it step by step :

  1. Download the Source for windows from

http://www.panda3d.org/download.php?platform=windows&version=1.7.0&sdk

1.a) Extract The full source code to a folder on your hard-disk (i.e. c:\Panda3D_Source )

  1. Download the Python debug version from
    http://152.10.254.215/~pro-rsoft/win-python-dbg.zip

2.a) Locate the “thirdparty” folder in the c:\Panda3D_Source folder you just created.

2.b) Copy the Python Debug folder into the “thirdparty” folder

  1. Locate the “makepanda” folder and open the makepanda.proj with visual studio 2008

  2. in the visual studio “solution explorer” right click on makepanda (the project) and select “properties”

4.a) Open the Configuration Properties tab
4.b) In the Command Arguments write
–everything --verbose --optimize 1 --outputdir debug

  1. Hit Apply and close the window

  2. Build

Note for 64bit system users :
If you got a 64 bit system you will most likely need to modify one line of the makepanda.bat.
Not sure if makepanda.bat is actually used by this method but it didnt hurt me to change it.
Open makepanda.bat in visualstudio (drag the file into the solution) and modify this line
if %PROCESSOR_ARCHITECTURE% == AMD64 goto :AMD64
into
REM if %PROCESSOR_ARCHITECTURE% == AMD64 goto :AMD64

I am testing this right now.
I willupdate the guide once its finished.

I had to install Visual Studio Service Pack 1 to get rid of an error

read more here http://social.msdn.microsoft.com/Forums/en/vclanguage/thread/9abfefe0-56bd-4a82-ae14-b08f262972bd

and now I am stuck with

1>------ Build started: Project: makepanda, Configuration: Debug Win32 ------
1>Performing Makefile project actions
1>Generating library cache...
1>Generating dependencies...
1>[ 46%] Linking dynamic library debug/bin/libpandaode_d.dll
1>   Creating library debug/lib/libpandaode_d.lib and object debug/lib/libpandaode_d.exp
1>ode.lib(convex.obj) : error LNK2019: unresolved external symbol __imp___invalid_parameter_noinfo referenced in function "public: bool __thiscall std::_Tree<class std::_Tset_traits<struct std::pair<unsigned int,unsigned int>,struct std::less<struct std::pair<unsigned int,unsigned int> >,class std::allocator<struct std::pair<unsigned int,unsigned int> >,0> >::const_iterator::operator==(class std::_Tree<class std::_Tset_traits<struct std::pair<unsigned int,unsigned int>,struct std::less<struct std::pair<unsigned int,unsigned int> >,class std::allocator<struct std::pair<unsigned int,unsigned int> >,0> >::const_iterator const &)const " (??8const_iterator@?$_Tree@V?$_Tset_traits@U?$pair@II@std@@U?$less@U?$pair@II@std@@@2@V?$allocator@U?$pair@II@std@@@2@$0A@@std@@@std@@QBE_NABV012@@Z)
1>debug/bin/libpandaode_d.dll : fatal error LNK1120: 1 unresolved externals
1>Storing dependency cache.
1>Elapsed Time: 4 sec
1>Build terminated.
1>Build log was saved at "file://c:\Panda3D_Source\debug\BuildLog.htm"
1>makepanda - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

anyone ?

I don’t know what that’s about; maybe the debug copy of the ODE library is out-of-date. But unless you actually need to use ODE in your build, you can avoid the issue by configure ODE off with --no-ode.

David

Lets hope one of the Developers can tell us what needs to be done :slight_smile:

Uhm… drwr is one of the developers.

He is right, compiling with --no-ode should work around the issue. If you want to build with ODE support, you’ll have to make your own debug build of ODE and include it in the thirdparty packages.

Sorry for getting back to this only 1 week later.

I did rebuild the ode libraries 0.11.1

I managed to get to 91% of the building process,
and now i get this :

Generating 'pandac' tree
thirdparty/win-python-dbg/python_d.exe direct\src\ffi\jGenPyCode.py -r libpandaexpress libpanda libpandaphysics libpandafx libp3direct libp3vision libpandaskel libpandaegg libpandaode

Importing code library: libpandaexpress 
  Found extensions for class: Ramfile 
  Found extensions for class: StreamReader 
  Found extensions for class: HTTPChannel 
Importing code library: libpanda 
  Found extensions for class: NodePath 
  Found extensions for class: Mat3 
  Found extensions for class: NodePathCollection 
  Found extensions for class: VBase3 
  Found extensions for class: VBase4 
Importing code library: libpandaphysics 
Importing code library: libpandafx 
Importing code library: libp3direct 
  Found extensions for class: CInterval
Importing code library: libp3vision
Importing code library: libpandaskel 
Importing code library: libpandaegg 
  Found extensions for class: EggPrimitive 
  Found extensions for class: EggGroupNode 
Importing code library: libpandaode 
Traceback (most recent call last): 
  File "direct\src\ffi\jGenPyCode.py", line 94, in <module> 
    DoGenPyCode.run() 
  File "c:\Panda3D_Source\PandaDebug\direct\ffi\DoGenPyCode.py", line 305, in run 
    generateNativeWrappers() 
  File "c:\Panda3D_Source\PandaDebug\direct\ffi\DoGenPyCode.py", line 258, in generateNativeWrappers 
    Dtool_PreloadDLL(moduleName) 
  File "c:\Panda3D_Source\PandaDebug\direct\extensions_native\extension_native_helpers.py", line 79, in Dtool_PreloadDLL 
    imp.load_dynamic(module, pathname)
ImportError: DLL load failed: The specified module could not be found.
[123955 refs]
Storing dependency cache. 
Elapsed Time: 41 min 41 sec 

Build terminated.

I have rebuild ode-0.11.1 and copied from the DebugSingleDLL the dll and the object file library into the ode folder in panda source. As well as the include folder of the 0.11.1 into the panda ode include folder.

Anyone knows what’s going on there ?

Well, now it’s on the final step, and it’s trying to import the resulting built dll into Python to generate a few wrapper files. This also tests that the dll was built correctly. The error message “The specified module cannot be found” comes from Windows and usually means that a dependency dll (like ODE or whatever it is that the build Panda dll will depend on) wasn’t found on your PATH.

David

are you talking about the environment variable “Path” ?

this is what mine looks like.

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Panda3D-1.7.0\python;C:\Panda3D-1.7.0\bin;C:\Program Files (x86)\cvsnt

do i need to add something to the Path ?

and this is where I try to build the debug version of panda.

C:\Panda3D Source

–everything --no-tinyxml --verbose --optimize 1 --outputdir PandaDebug

if i look into the folder

C:\Panda3D Source\PandaDebug\bin

there is actually a libpandaode_d.dll but the makepanda seems to be refering to a libpandaode rather than “_d” or has that nothing to do with ?

It’s more than that. libpandaode_d.dll is the Panda library that you just build that references ODE. But ODE may itself be stored in a different DLL that also has to be on your PATH variable.

Or maybe not. It might be some different library, other than ODE. Or something else altogether; I’m just guessing here. You can use the dumpbin tool to help track down dependencies like this: use “dumpbin /dependents libpandaode_d.dll”, for instance, to list the DLL’s that libpandaode_d.dll requires you to have on you PATH. You can do this for all of the Panda DLL’s in turn to make sure that all of the requirements are available.

David

I have finally been able to create a debug version of Panda and run it, cheers guys.

for sake of completeness I write here what I did :

launch VS2008 console :

c:\Program Files (x86)\Microsoft Visual Studio 9.0\BC\bin > dumpbin.exe /dependets “c:\PandaDebug\bin\libpandaode_d.dll”

came out with a dependency on “ode_singled.dll”

which is the ode version that I had built myself.

So I have added “ode_singled.dll” to the
c:\PandaDebug\bin folder (now containing ode.dll and ode_singled.dll)

now all compiles fine but I get the impression something is wrong (mainly because ode.dll and ode_singled.dll are basically the same file with different name, so the build process used ode.dll and the python part of the build process uses a dependancy on ode_singled.dll )
Note: I had copied my ode_singled.dll before and renamed it to ode.dll to substitute the old ode version that was in the original third party source code package

Next thing I will try is getting everything out of CVS rather than trying to install from the source package on the website.

Reason why I havent done that yet is because I didnt have internet over the last month :-/

cheers so far,
chrys