g++ errors out

Starting compile in “panda/src/gobj” (12 min 46 sec):

g++ -ftemplate-depth-30 -c -o built/tmp/gobj_composite1.o
-I"/usr/include/python2.3" -Ithirdparty/linux-libs-a/nspr/include -Ibuilt/tmp
-Ipanda/src/gobj -Ibuilt/include -O2 -DBUILDING_PANDA
panda/src/gobj/gobj_composite1.cxx
g++ -ftemplate-depth-30 -c -o built/tmp/gobj_composite2.o
-I"/usr/include/python2.3" -Ithirdparty/linux-libs-a/nspr/include -Ibuilt/tmp
-Ipanda/src/gobj -Ibuilt/include -O2 -DBUILDING_PANDA
panda/src/gobj/gobj_composite2.cxx
cd panda/src/gobj ; …/…/…/built/bin/interrogate -DCPPPARSER -D__STDC__=1
-D__cplusplus -D__i386__ -D__const=const -S…/…/…/built/include/parser-inc
-S/usr/include -I…/…/…/built/python/include
-I…/…/…/thirdparty/linux-libs-a/nspr/include -oc
…/…/…/built/tmp/libgobj_igate.cxx -od
…/…/…/built/pandac/input/libgobj.in -fnames -string -refcount -assert
-python -I…/…/…/built/tmp -I…/…/…/panda/src/gobj
-I…/…/…/built/include -DBUILDING_PANDA -module panda -library libgobj
boundedObject.h config_gobj.h drawable.h geom.h geomContext.h geomLine.h
geomLinestrip.h geomPoint.h geomPolygon.h geomQuad.h geomSphere.h geomSprite.h
geomTri.h geomTrifan.h geomTristrip.h imageBuffer.h material.h materialPool.h
matrixLens.h orthographicLens.h perspectiveLens.h pixelBuffer.h
preparedGraphicsObjects.h lens.h savedContext.h texture.h textureContext.h
texturePool.h texCoordName.h textureStage.h gobj_composite1.cxx
gobj_composite2.cxx
*** Error in …/…/…/built/include/throw_event.h near line 31, column
49:
syntax error, unexpected IDENTIFIER
Error parsing file: ‘gobj_composite2.cxx’

and the progam text it’s barfing on is:-

// A handful of convenience functions to throw events.
INLINE void throw_event(const CPT_Event &event);
INLINE void throw_event(const string &event_name);
INLINE void throw_event(const string &event_name,
const EventParameter &p1);
INLINE void throw_event(const string &event_name,
const EventParameter &p1, // Line 31.
const EventParameter &p2);
INLINE void throw_event(const string &event_name,
const EventParameter &p1,
const EventParameter &p2,
const EventParameter &p3);

Using gcc-3.4 which does not like having ‘throw_event’ being redefined.

Thanks in Advance for a bit of help
Christopher Sawtell

Actually, the error is not being generated by gcc, but by a program called interrogate which is part of the Panda distribution, and also parses the C++ code.

It is not clear why this error is being generated. Certainly interrogate has no problem with function overloading. It is as if interrogate doesn’t know what EventParameter is, which is strange. Try inserting the line:


#include "eventParameter.h"

in the beginning of throw_event.h.

David

That fixed that problem. Many thanks. Now for your next opportunity to do telepathy with a sick compilation. :slight_smile:

g++ -ftemplate-depth-30 -c -o built/tmp/chan_composite2.o
-I"/usr/include/python2.3" -Ithirdparty/linux-libs-a/nspr/include -Ibuilt/tmp
-Ipanda/src/chan -Ibuilt/include -O2 -DBUILDING_PANDA
panda/src/chan/chan_composite2.cxx
cd panda/src/chan ; …/…/…/built/bin/interrogate -DCPPPARSER -D__STDC__=1
-D__cplusplus -D__i386__ -D__const=const -S…/…/…/built/include/parser-inc
-S/usr/include -I…/…/…/built/python/include
-I…/…/…/thirdparty/linux-libs-a/nspr/include -oc
…/…/…/built/tmp/libchan_igate.cxx -od
…/…/…/built/pandac/input/libchan.in -fnames -string -refcount -assert
-python -I…/…/…/built/tmp -I…/…/…/panda/src/chan
-I…/…/…/built/include -DBUILDING_PANDA -module panda -library libchan
animBundle.h animBundleNode.h animChannel.h animChannelBase.h
animChannelMatrixDynamic.h animChannelMatrixXfmTable.h
animChannelScalarDynamic.h animChannelScalarTable.h animControl.h
animControlCollection.h animGroup.h auto_bind.h config_chan.h movingPartBase.h
movingPartMatrix.h movingPartScalar.h partBundle.h partBundleNode.h
partGroup.h vector_PartGroupStar.h chan_composite1.cxx chan_composite2.cxx
Type unknown const * is unknown to parser.
Invalid CPPSimpleType: 6
Type unknown const * is unknown to parser.
Type unknown const * is unknown to parser.
Type unknown const * is unknown to parser.
Type unknown const * is unknown to parser.
g++ -ftemplate-depth-30 -c -o built/tmp/libchan_igate.o
-I"/usr/include/python2.3" -Ithirdparty/linux-libs-a/nspr/include -Ibuilt/tmp
-Ipanda/src/chan -Ibuilt/include -O2 -DBUILDING_PANDA
built/tmp/libchan_igate.cxx
built/tmp/libchan_igate.cxx: In function PyObject* _inPn9gMBf7m(PyObject*, PyObject*)': built/tmp/libchan_igate.cxx:947: error:unknown’ undeclared (first use this function)
built/tmp/libchan_igate.cxx:947: error: (Each undeclared identifier is reported only once for each function it appears in.)
built/tmp/libchan_igate.cxx:947: error: parse error before const' built/tmp/libchan_igate.cxx: In functionPyObject* _inPn9gMxJNw(PyObject*, PyObject*)’:
built/tmp/libchan_igate.cxx:1000: error: parse error before const' built/tmp/libchan_igate.cxx: In functionPyObject* _inPn9gMvhFy(PyObject*, PyObject*)’:
built/tmp/libchan_igate.cxx:1187: error: parse error before const' built/tmp/libchan_igate.cxx: In functionPyObject* _inPn9gMdyqV(PyObject*, PyObject*)’:
built/tmp/libchan_igate.cxx:2471: error: parse error before const' built/tmp/libchan_igate.cxx: In functionPyObject* _inPn9gMRoZz(PyObject*, PyObject*)’:
built/tmp/libchan_igate.cxx:2546: error: template argument 1 is invalid
built/tmp/libchan_igate.cxx:2546: error: ISO C++ forbids declaration of return_value' with no type built/tmp/libchan_igate.cxx:2546: error: invalid conversion fromconst Event*’ to `int’

Your help is most appreciated. Thanks

Hmm. Also very strange.

Did you get your copy of the Panda3D source tree from one of the downloadable tarballs available on this website, or did you by chance download it directly from CVS?

David

As a download, I forget where it came from.
Here are the details:

imogen ~ # ls -l /usr/portage/distfiles/panda3d-1.0.4.tar.gz
-rw-r–r-- 1 root root 28253758 May 25 18:04 /usr/portage/distfiles/panda3d-1.0.4.tar.gz

md5sum:-

ffcf3b0636d431b4a212216a980c2aea /usr/portage/distfiles/panda3d-1.0.4.tar.gz

Which options did you use for makepanda?

David