I’m trying to compile the hello world example from the manual using VC++ 2005, but I keep receiving errors. I’m really not sure what to do to fix it- I checked over my includes and changed the compile mode to release, but the errors stayed the same. How do I get rid of these?
1>------ Build started: Project: MyProject, Configuration: Release Win32 ------
1>Compiling...
1>Main.cpp
1>c:\panda3d-1.5.3\include\threadDummyImpl.I(125) : error C2079: 'rqtp' uses undefined struct 'ThreadDummyImpl::sleep::timespec'
1>c:\panda3d-1.5.3\include\threadDummyImpl.I(126) : error C2228: left of '.tv_sec' must have class/struct/union
1> type is 'int'
1>c:\panda3d-1.5.3\include\threadDummyImpl.I(127) : error C2228: left of '.tv_nsec' must have class/struct/union
1> type is 'int'
1>c:\panda3d-1.5.3\include\threadDummyImpl.I(127) : error C2228: left of '.tv_sec' must have class/struct/union
1> type is 'int'
1>c:\panda3d-1.5.3\include\threadDummyImpl.I(127) : fatal error C1903: unable to recover from previous error(s); stopping compilation
1>Build log was saved at "file://c:\Documents and Settings\Administrator\Desktop\MyProject\MyProject\Release\BuildLog.htm"
1>MyProject - 5 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
It seems like the symbol WIN32 is not defined. Don’t know why not; I thought that one was defined automatically by MSVC. Well, try adding that symbol to your project, along with WIN32_VC.
#ifndef WIN32
#define WIN32
#ifndef WIN32_VC
#define WIN32_VC
#include "pandaFramework.h"
#include "pandaSystem.h"
PandaFramework framework;
int main(int argc, char *argv[]) {
//open a new window framework
framework.open_framework(argc, argv);
//set the window title to My Panda3D Window
framework.set_window_title("My Panda3D Window");
//open the window
WindowFramework *window = framework.open_window();
//here is room for your own code
//do the main loop, equal to run() in python
framework.main_loop();
//close the window framework
framework.close_framework();
return (0);
}
Here’s the new error:
1>c:\panda3d-1.5.4\include\threadDummyImpl.h(30) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
Maybe my includes are wrong?
Executable Files:
C:\Panda3D-1.5.4\bin
Include Files:
C:\Panda3D-1.5.4\include
C:\Panda3D-1.5.4\python\include
Library Files:
C:\Panda3D-1.5.4\lib
C:\Panda3D-1.5.4\python\libs
(I didn’t change any defaults in VC++)
David, everyone seems to be running into this issue. Can we add an internal check into Panda that defines WIN32 and WIN32_VC if _WIN32 is defined?
I believe all windows compilers have to define _WIN32 by default.