Compiled Panda on VS2013 but have runtime assertion

Hi,

I compiled Panda 1.81 with VS2013 Express today. With a few minor code changes I got it to compile as static debug lib (though thinking about it I never specified debug in makepanda…). Anyway, I got my code I had running ok in VS2008 to compile eventually, but then I got a runtime assertion from Panda on this line:

 NodePath np_ground = window->get_render().attach_new_node(floor_rigid_node);

To give it some context:

 PandaFramework framework;    
PT(AsyncTaskManager) task_mgr;
 
    // Init everything :D
    framework.open_framework(argc, argv);
    framework.set_window_title("Bullet Physics");
 
    window = framework.open_window();
    window->enable_keyboard();
	
	Application* app = new Application(window);
	hud = new HUD();

	// Let's say I wanna get the key "w"
	//framework.define_key("w", "forwardalign", Move, 0);
	framework.define_key("w", "forward", Move,  0);
	framework.define_key("w-up", "forwardrepeat", Move, 0);
	framework.define_key("s", "back", Move, 0);
	framework.define_key("s-up", "backup", Move, 0);
	framework.define_key("a", "left", Move, 0);
	framework.define_key("a-up", "leftup", Move, 0);
	framework.define_key("d", "right", Move, 0);
	framework.define_key("d-up", "rightup", Move, 0);
	

    task_mgr = AsyncTaskManager::get_global_ptr();
 
    // Make physics simulation.
    // Static world stuff.
	Application::GetPhysicsWorld()->set_gravity(0, 0, -9.8);
 
    BulletPlaneShape *floor_shape = new BulletPlaneShape(*new LVecBase3f(0, 0, 1), 1);
    BulletRigidBodyNode *floor_rigid_node = new BulletRigidBodyNode("Ground");
    floor_rigid_node->add_shape(floor_shape);
 
    NodePath np_ground = window->get_render().attach_new_node(floor_rigid_node);

I get the following assertion:

Expression: rnode != (TypeRegistryNode*)NULL at typeHandler.cxx line 76

This code runs ok in VS2008 Express using the prebuilt dlls. I’m going to look into this myself, but wondered if anyone has seen this or actually understands it. I rebuilt Bullet with VS2013 thinking that would fix it, but apparently not.

Cheers,
Zobbo

Are you constructing the PandaFramework at static init time? If so, try moving it to within the main(), or make it a pointer or something.

I’d also like to see a stack trace for that assertion.

It seems to be an issue following add_shape on a BulletRigidBody. I have two rigidbody objects, if they both crash following add_shape if I try to do anything, such as the line in the above posts or setting the mass of my other rigid body. I also have a BulletCharacterControllerNode and that doesn’t have a problem.

I’ve changed a lot of the code but to no avail, still the same error in the same place. WindowFrameWork is now a pointer instead of a static pointer. Interestingly the call stack shows the VS2008 runtime…oh dear. Maybe I have to change some compiler options in makepanda.py. The only change I made before was to add manifest. Bit weird since all the bullet and panda libs are showing as version x86 version 11.

 	msvcr90.dll!741b3469()	Unknown
 	[Frames below may be incorrect and/or missing, no symbols loaded for msvcr90.dll]	
 	libp3dtool.dll!0068c1da()	Unknown
 	libpandabullet.dll!02cb8b89()	Unknown
 	libpandabullet.dll!02cb923e()	Unknown
 	libpandabullet.dll!02cd1050()	Unknown
 	libpandabullet.dll!02cf796e()	Unknown
 	libpandabullet.dll!02cfb325()	Unknown
>	pandatest.exe!Application::Run() Line 48	C++

I should probably try one of the simple examples to see if it works.

Yes, if you insist on using VC2013, you have to recompile all of Panda using VC2013 (adjusting the makepanda script where necessary); you may have to compile some or all of the thirdparty packages as well. In this case, the issue seems to be that Bullet is compiled with VC2008.

It’d be a lot less painful if you used current CVS Panda as a starting point, which we compile with VC2010, and possibly the thirdparty packages that I compiled with VC2010:


I’ve heard that some people have had some luck with using these thirdparty packages to compile Panda in VC2013, even though the version is mismatching.

Still, I’d suggest that you switch VC2013 to use the compilers from the Windows 7 SDK (ie. the VC2010 compilers) if this is at all possible, or otherwise using VC2010.

Hi rdb,

I have re-compiled panda and Bullet using VC2013 (it’s the only compiler I have installed now), and I know they’re correct since they are in different locations to the VS2008 pre-compiled libs and they’re all marked as version VS2013 libs, that’s why I was confused that msvcr90.dll is displayed in the call stack. I think it’s a red herring since the stack includes libpanadabullet.dll, so I assume using the static libs loads the DLLS at runtime? I don’t really know how that works. Anyway, I’ve compiled and linked statically using libs. I didn’t specify static explicitly in makepanda though so I wonder if that caused a problem.

I’ll look at the CVS, that’s a better idea. I’m using the inbuilt SDK with VS2013 so I’ll point it to the Win 7 SDK also and see if it works.

Since I’m using VS Express, using 2008 is painful and I wouldn’t want to do serious work with it, whereas 2012/13 Express are much better. I guess if all else fails I can use VS2010.

Thanks,
Zobbo

I think I know what I’ve done. I had trouble compiling Python with makepanda so excluded it (since I’m using C++) and also didn’t generate an installer because it requires Python.

So presumably you need to build the installer for the runtime to be compatible. I didn’t think about that. It makes sense if that’s the case that the original runtime I was using was built in VS2008 barfs at trying to use the VS2013 built libs, and also why it shows in the call stack as VS2008 crt.

Well, the story so far is I got some Link errors which I couldn’t fix when Python was enabled, so I dropped Python and --installer, but got the following (with CVS checked out yesterday) error. It looks like this function is not implemented in VS2013 but is being added in VS2014, so I just manually changed it for now:
https://connect.microsoft.com/VisualStudio/feedback/details/809403/error-c3861-snprintf-identifier-not-found-in-visual-studio-2013

c:\users\zobbo\dev\pandasource\panda3d\panda\src\gobj\shader.cxx(1433) : error C3861: 'snprintf': identifier not found

I’m a bit confused about the runtime though. Do I need to build with --installer to build a runtime installer, or can I just rebuild with the runtime only option? Since I’ll need a runtime built with V12 of VC. Also Debug builds don’t seem to be supported so I guess I’ll just hack that for now, everything seems to be geared for Release builds on Windows.

Cheers,

You’ll want the SDK if you want to link your C++ applications against it. Just adding --installer to the end would build an installer for the SDK.

What do you plan on doing with a runtime build?

Don’t I need the runtime to run the project? That was my original problem (I suspect), my build of panda libs was done using VC2013 but the runtime was 1.8.1 so it was built under 2008.

No, you don’t, especially if you’re using C++. The SDK is what you can use to develop and run Panda programs developed in C++.

The runtime is used solely to run .p3d archives, which contain compiled Python code written for a particular runtime distribution of Panda3D (like a .jar file or an .swf file). This mechanism is largely useless for C++ users.

Ok,thanks for that, that’s how I originally thought of it but confused myself at some point. I won’t need the runtime in that case. I’ll branch the VS2013 build and continue with VS2008 to get my actual game going because compiling Panda is a time sink with only one machine, but hopefully I’ll get there eventually.

Cheers,

I would recommend you stick with VS2010 instead of VS2008 and use a development version of Panda (all buildbot SDK builds are VS2010 too). Panda 1.9 ìs just around the corner and is built with VS2010 and I’d hate for you to have to switch everything over again.

Also see:

Thanks rdb, yeah that sounds like a more sensible idea. Good to hear 1.9 is coming out soon.