Exception when trying to create window.

I’ve just succeeded in setting the right directories and compiling the code. However, when I run the following program, instead of a window gray window appearing on the screen, an exception occurs. Can anyone help me with this?

#include <pandaFramework.h>
#include <pandaSystem.h>

PandaFramework framework;

int main(int argc, char*argv[])
{
	framework.open_framework(argc, argv);

	framework.set_window_title("My Panda App");

	WindowFramework *window = framework.open_window();

	framework.main_loop();

	framework.close_framework();
	return 0;
}
'hdhd.exe': Loaded 'C:\Users\Guido\Desktop\hdhd\Release\hdhd.exe', Symbols loaded.
'hdhd.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Panda3D-1.7.0\bin\libp3framework.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Panda3D-1.7.0\bin\libpanda.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Panda3D-1.7.0\bin\libpandaexpress.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Panda3D-1.7.0\bin\libp3dtool.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\shell32.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\gdi32.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\user32.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\advapi32.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\rpcrt4.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\shlwapi.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4148_none_5090ab56bcba71c2\msvcr90.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Panda3D-1.7.0\python\python26.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4148_none_5090ab56bcba71c2\msvcp90.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Panda3D-1.7.0\bin\libp3dtoolconfig.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\wsock32.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\ws2_32.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\nsi.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\winmm.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\ole32.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\oleaut32.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\oleacc.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Panda3D-1.7.0\bin\cg.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Panda3D-1.7.0\bin\avcodec-51-panda.dll', Binary was not built with debug information.
'hdhd.exe': Loaded 'C:\Panda3D-1.7.0\bin\avutil-49-panda.dll', Binary was not built with debug information.
'hdhd.exe': Loaded 'C:\Panda3D-1.7.0\bin\avformat-50-panda.dll', Binary was not built with debug information.
'hdhd.exe': Loaded 'C:\Windows\System32\msvcp100.dll', Symbols loaded.
'hdhd.exe': Loaded 'C:\Windows\System32\msvcr100.dll', Symbols loaded.
'hdhd.exe': Loaded 'C:\Windows\System32\imm32.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\msctf.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\lpk.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\System32\usp10.dll', Cannot find or open the PDB file
'hdhd.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6001.18000_none_5cdbaa5a083979cc\comctl32.dll', Cannot find or open the PDB file
First-chance exception at 0x7387af68 in hdhd.exe: 0xC0000005: Access violation reading location 0x61646e61.
Unhandled exception at 0x7387af68 in hdhd.exe: 0xC0000005: Access violation reading location 0x61646e61.
The program '[1368] hdhd.exe: Native' has exited with code 0 (0x0).

[/code]

So, I have to ask the obvious questions, since you didn’t specify this:

(1) Are you sure you have compiled your application using Release mode, and not Debug mode?

(2) Are you sure you have removed the NDEBUG symbol that is added when you compile in Release mode?

(3) Can you run pview successfully?

David

(1) Yes.
(2) I never knew about it.
(3) I don’t know what pview is.

(2) it’s also mentioned on the same manual page that describes the importance of (1).
(3) pview.exe was installed when you installed the Panda3D SDK. It’s a model-viewer program that, among other things, opens a standard Panda window. I just want to verify that your Panda installation itself is in good shape–if pview doesn’t work, then we don’t need to diagnose problems with your project file.

Can you show the stack trace at the time of the crash in the Microsoft debugger?

David

I cannot find the NDEBUG definition anywhere. It is not shown in preprocessors.

However, I did find these items in the call stack window.

 	hdhd.exe!main(int argc=1, char * * argv=0x03d339e8)  Line 17 + 0x37 bytes	C++
>	hdhd.exe!__tmainCRTStartup()  Line 555 + 0x17 bytes	C

Oh, and I’ve run the python examples successfully.

Which version of the compiler are you using? 2008 or 2010? I’m not 100% sure that 2010 has been well tested.

I bet the NDEBUG definition is there somewhere. It always adds it by default when I create a project in mode Release.

The fact that you can run the Python demos is encouraging, but it would also be nice to confirm that you can successfully run pview.exe.

David