SO I went through the manual for C++ using.
I decided to take their script on the end of the tutorial, However:
Strangely,
It won’t allow me to use C++.
It will say the code is invalid.
I’m using PyPE.
How can I use C++???
I’m going to college for this stuff, And they do C++.
Not Python, So I might as well only use C++.
the code you displayed has two typos:
first is:
WindowFramwork *window = framework.open_window();
need an “e” in WindowFramework
second is:
fraimwork.main_loop();
should be
framework.main_loop();
I compile with Visual Studio 2008 Express,
and running produces the basic gray Panda window.
#include "pandaFramework.h"
#include "pandaSystem.h"
PandaFramework framework;
int main(int argc, char *argv[]) {
framework.open_framework(argc,argv);
framework.set_window_title("Hello World!");
WindowFramework *window = framework.open_window();
if (window != (WindowFramework *)NULL) {
nout << "Opened the window successfully!\n";
window->enable_keyboard();
window->setup_trackball();
framework.main_loop();
} else {
nout << "Could not load the window!\n";
}
framework.close_framework();
return (0);
}
Well see, I’m trying to be able to code in C++ other than Python.
And in the manual, this is what it described as what to put in as far as using C++ instead.
I copy pasted but it told me I had errors, which I did not see (not the typos listed above).
I’m using PyPE
“the code is invalid” is vague. You should tell us exactly which error message you’re getting and what exactly you’re doing to produce the error message.
You’re using PyPE? That’s probably the issue, you’re using an IDE designed for the Python language and that’s why it can’t compile the C++ code; you’ll need to download and install a C++ compiler and IDE (such as Visual Studio) and then you should be good to go.