質問

I'm trying to build the Solar-System (C++) Panda3D example for version 1.8. The problem I'm having is that when I compile it I get an error:

clr; g++ -c ./solar_system/tut_solar_system.cpp -o ss.o -fPIC -L/usr/lib/panda3d -I/usr/include/python2.7 -I/usr/include/panda3d
./solar_system/../p3util/cOnscreenText.h:75:22: error: ‘Colorf’ does not name a type

I have tried editing that file and including glew, glext, and glut (provided by my distro), as well as the "panda_glext" provided by Panda3D - none of those provides ColorF. (I am using archlinux and I have glew, glext, and freeglut.)

I don't know where to start looking. Google has failed me! Does anyone know where ColorF is defined?

役に立ちましたか?

解決

It is called LColorf, and it is a typedef for LVecBase4f, which is the generic Panda3D class for four-component floating-point values (such as vectors and colours). The 'f' stands for 'float'; there is also an LColord typedef available.

This was a change in Panda3D 1.8.0. Before 1.8.0, it was called Colorf (without the leading L). Presumably, the sample programs you downloaded were designed for an earlier version. You may change the relevant sample program to use LColorf, or you may choose to add the following before including these headers:

#if PANDA_NUMERIC_VERSION >= 1008000
#define Colorf LColorf
#endif

(Alternatively, you could use a typedef if that is what you prefer.)

For the record, the appropriate header file to include to make the LColorf symbol available is luse.h. You should not include panda_glext.h, it is only used by the OpenGL renderer.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top