Cannot Run Compiled Application

I’m sorry if anyone thinks I shouldn’t be posting again, but I wanted to compile a list of the things I’ve tried and hope a kind soul has enough information to be able to finally help once and for all.

What I did was this:

  1. I downloaded and installed Panda3D (1.7.0), Visual C++ Express 2010 and the Platform SDK (7.0, now the Windows SDK).

  2. I set up my project per the manual. I changed the configuration to “Release” instead of “Debug.” I added all necessary libraries, directories and includes to my project. I ensured the NDEBUG directive isn’t set.

  3. I went through the Hello World Tutorial in the manual for C++. I will refer to the steps as versions here. Version 1 is simply creating the window. (panda3d.org/manual/index.php/C … the_Camera) Please reference the C++ pages as the links will default to the Python pages.

Version 1, creating the window:
My code compiles and runs. I have an anomaly with my window title.

Not sure what’s causing it, but I thought that since the program was compiling without error that everything was set up properly.

Version 2, loading geometry:
This version also compiled perfectly. Again, I received the same title as above.

Version 3, adding controls:
Upon compiling, I receive an error message box stating

“Microsoft Visual Studio C Runtime Library has detected a fatal error in Panda3D.exe.”

I’m offered the option to continue to end the program or break to debug it. Note that in this case, “Panda3D.exe” is the name of my compiled executable. I thought on the off chance that spaces in my file name were causing errors, so I changed my output file name to Panda3D.exe.

Troubleshooting Info:

  1. The sample applications all run perfectly, though those are Python examples, not C++.
  2. pveiw.exe runs perfectly.
  3. MakePanda causes all sorts of headaches, but I’m willing to try to get it compiling with some help from others. My last posts on the forum were figuring this part out, but the plan never came to fruition.

Any information would be extremely helpful here. I would like to get this project underway, but if I can’t get the tutorial applications going, the future looks grim indeed. My code is posted below, just in case anyone needs to verify I didn’t make any changes that FUBAR’d anything.

Thanks for the help in advance!

~ David

#include "pandaFramework.h"
#include "pandaSystem.h"
// V.3 Code Lines 3 through 5
#include "genericAsyncTask.h"
#include "asyncTaskManager.h"
 
PandaFramework framework;

// V.3 Code Lines 9 through 22
PT(AsyncTaskManager) taskMgr = AsyncTaskManager::get_global_ptr(); 
PT(ClockObject) globalClock = ClockObject::get_global_clock();
NodePath camera;
 
AsyncTask::DoneStatus spinCameraTask(GenericAsyncTask* task, void* data) {
  double time = globalClock->get_real_time();
  double angledegrees = time * 6.0;
  double angleradians = angledegrees * (3.14 / 180.0);
  camera.set_pos(20*sin(angleradians),-20.0*cos(angleradians),3);
  camera.set_hpr(angledegrees, 0, 0);
 
  return AsyncTask::DS_cont;
}

int main(int argc, char *argv[]) {
	framework.open_framework(argc, argv);
	framework.set_window_title("My Panda3D Window");
	WindowFramework *window = framework.open_window();

	// V.3 Code Lines 29 and 30
	camera = window->get_camera_group();

	// V.2 Code Lines 11 through 15
    NodePath environ = window->load_model(framework.get_models(), "models/environment");
    environ.reparent_to(window->get_render());
    environ.set_scale(0.25, 0.25, 0.25);
    environ.set_pos(-8, 42, 0);

	// V.3 Code Lines 38 and 39
	taskMgr->add(new GenericAsyncTask("Spins the camera", &spinCameraTask, (void*) NULL));

	framework.main_loop();
	framework.close_framework();
	return (0);
}

Edit: Typo/Extraneous Tag

I have the same prob under vs2010.
I need some help with that also…
NOTE, in vs2008 it’s work good…

10x!

We don’t support Visual Studio 2010.