compiling using GCC 4.7 fails

There is, apparently, a bug in GCC 4.7 that makes it unable to resolve a member function defined in a parent class that stops the build from being able to complete. This is the output from it (and yes, this is the default compiler of Fedora 17)

[  9%] Building C++ object built/tmp/p3pipeline_composite1.o
In file included from built/include/nodePointerTo.h:85:0,
                 from panda/src/pipeline/pipelineCyclerTrueImpl.h:26,
                 from panda/src/pipeline/pipelineCyclerBase.h:25,
                 from panda/src/pipeline/pipelineCycler.h:19,
                 from panda/src/pipeline/cycleDataLockedReader.h:21,
                 from panda/src/pipeline/cycleDataLockedReader.cxx:15,
                 from panda/src/pipeline/p3pipeline_composite1.cxx:15:
built/include/nodePointerTo.I: In instantiation of ‘NodePointerTo<T>& NodePointerTo<T>::operator=(const NodePointerTo<T>&) [with T = CycleData]’:
panda/src/pipeline/pipelineCyclerTrueImpl.I:466:30:   required from here
built/include/nodePointerTo.I:136:3: error: ‘reassign’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
built/include/nodePointerTo.I:136:3: note: declarations in dependent base ‘NodePointerToBase<CycleData>’ are not found by unqualified lookup
built/include/nodePointerTo.I:136:3: note: use ‘this->reassign’ instead
Storing dependency cache.
Elapsed Time: 6 sec
The following command returned a non-zero value: g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/p3pipeline_composite1.o -Ibuilt/tmp -Ibuilt/include -I/usr/include/python2.7 -DMAKEPANDA= -Ipanda/src/pipeline -pthread -msse2 -O2 -DBUILDING_PANDA panda/src/pipeline/p3pipeline_composite1.cxx
Build terminated.

I have checked the code and don’t want to have to edit it, because I’m sure this is going to keep coming up and I’m not familiar with the code base. Is the suggestion of using “this->reassign” a good one ?

Edit:
fixing it to follow the suggestion at both line 122 and line 136 seems to have worked and the build is once more on track.

Welcome to the forums!

Which version of the source did you use? I remember fixing something like this before.

.

But makepanda recreate a nodePointerTo.I file with “reassign” instead of “this->reassign”.
As you edit the file?

.

Thanks :slight_smile:

I’ve tried both 1.7.2 and 1.8.0 and gotten similar errors. The tutorial code also fails with a similar error - though I haven’t checked to see if the solution in this thread can also apply to the tutorials code.

It was probably fixed in the CVS version of Panda, then.

I compiled panda with gcc 4.7.2 from cvs and found a similar error with threadSafePointerTo.I when compiling my code:

...
/usr/include/panda3d/threadSafePointerTo.I:107:3: error: 'reassign' was not declared in this scope ...
...

I fixed this temporarily in /usr/include/panda3d/threadSafePointerTo.I (the same way shown in this topic), but I think should be fixed in panda source too.

Thank you, I’ll commit a fix.

Sorry but it seems the problem is still there (it should be on ThreadSafeConstPointerTo which was not patched):

...
/usr/include/panda3d/threadSafePointerTo.I:229:3: error: 'reassign' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
...
/usr/include/panda3d/threadSafePointerTo.I:253:3: error: 'reassign' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
...

bye

Thank you, committed.