Compiling of p3movies_composite1.cxx fails

Hi,

on Ubuntu 12.10, I obtain the following error when trying to compile the most recent cvs panda code using makepanda:

In file included from panda/src/movies/p3movies_composite1.cxx:16:0:
panda/src/movies/wavAudioCursor.cxx: In member function ‘virtual void WavAudioCursor::seek(double)’:
panda/src/movies/wavAudioCursor.cxx:301:75: error: no matching function for call to ‘min(double, size_t&)’
panda/src/movies/wavAudioCursor.cxx:301:75: note: candidates are:
In file included from /usr/include/c++/4.7/bits/char_traits.h:41:0,
                 from /usr/include/c++/4.7/ios:41,
                 from /usr/include/c++/4.7/ostream:40,
                 from /usr/include/c++/4.7/iostream:40,
                 from built/include/dtoolbase_cc.h:54,
                 from built/include/dtoolbase.h:422,
                 from built/include/pandabase.h:22,
                 from panda/src/movies/config_movies.h:18,
                 from panda/src/movies/config_movies.cxx:15,
                 from panda/src/movies/p3movies_composite1.cxx:1:
/usr/include/c++/4.7/bits/stl_algobase.h:187:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
/usr/include/c++/4.7/bits/stl_algobase.h:187:5: note:   template argument deduction/substitution failed:
In file included from panda/src/movies/p3movies_composite1.cxx:16:0:
panda/src/movies/wavAudioCursor.cxx:301:75: note:   deduced conflicting types for parameter ‘const _Tp’ (‘double’ and ‘size_t {aka long unsigned int}’)
In file included from /usr/include/c++/4.7/bits/char_traits.h:41:0,
                 from /usr/include/c++/4.7/ios:41,
                 from /usr/include/c++/4.7/ostream:40,
                 from /usr/include/c++/4.7/iostream:40,
                 from built/include/dtoolbase_cc.h:54,
                 from built/include/dtoolbase.h:422,
                 from built/include/pandabase.h:22,
                 from panda/src/movies/config_movies.h:18,
                 from panda/src/movies/config_movies.cxx:15,
                 from panda/src/movies/p3movies_composite1.cxx:1:
/usr/include/c++/4.7/bits/stl_algobase.h:233:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
/usr/include/c++/4.7/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
In file included from panda/src/movies/p3movies_composite1.cxx:16:0:
panda/src/movies/wavAudioCursor.cxx:301:75: note:   deduced conflicting types for parameter ‘const _Tp’ (‘double’ and ‘size_t {aka long unsigned int}’)
panda/src/movies/wavAudioCursor.cxx: In member function ‘virtual void WavAudioCursor::read_samples(int, PN_int16*)’:
panda/src/movies/wavAudioCursor.cxx:341:79: error: no matching function for call to ‘min(int&, long unsigned int)’
panda/src/movies/wavAudioCursor.cxx:341:79: note: candidates are:
In file included from /usr/include/c++/4.7/bits/char_traits.h:41:0,
                 from /usr/include/c++/4.7/ios:41,
                 from /usr/include/c++/4.7/ostream:40,
                 from /usr/include/c++/4.7/iostream:40,
                 from built/include/dtoolbase_cc.h:54,
                 from built/include/dtoolbase.h:422,
                 from built/include/pandabase.h:22,
                 from panda/src/movies/config_movies.h:18,
                 from panda/src/movies/config_movies.cxx:15,
                 from panda/src/movies/p3movies_composite1.cxx:1:
/usr/include/c++/4.7/bits/stl_algobase.h:187:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
/usr/include/c++/4.7/bits/stl_algobase.h:187:5: note:   template argument deduction/substitution failed:
In file included from panda/src/movies/p3movies_composite1.cxx:16:0:
panda/src/movies/wavAudioCursor.cxx:341:79: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘long unsigned int’)
In file included from /usr/include/c++/4.7/bits/char_traits.h:41:0,
                 from /usr/include/c++/4.7/ios:41,
                 from /usr/include/c++/4.7/ostream:40,
                 from /usr/include/c++/4.7/iostream:40,
                 from built/include/dtoolbase_cc.h:54,
                 from built/include/dtoolbase.h:422,
                 from built/include/pandabase.h:22,
                 from panda/src/movies/config_movies.h:18,
                 from panda/src/movies/config_movies.cxx:15,
                 from panda/src/movies/p3movies_composite1.cxx:1:
/usr/include/c++/4.7/bits/stl_algobase.h:233:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
/usr/include/c++/4.7/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
In file included from panda/src/movies/p3movies_composite1.cxx:16:0:
panda/src/movies/wavAudioCursor.cxx:341:79: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘long unsigned int’)
The following command returned a non-zero value: g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/p3movies_composite1.o -Ibuilt/tmp -Ibuilt/include -I/usr/include/python2.7 -Ipanda/src/movies -pthread -O2 -DBUILDING_PANDA panda/src/movies/p3movies_composite1.cxx

Is there any work around?

Thanks for your help
Best
Timo

Sorry about that. Just checked in a fix to wavAudioCursor.cxx, try and see if this fixes it.

Thanks for your fast answer!

With the fix, the error changed to a warning:

In file included from panda/src/movies/p3movies_composite1.cxx:16:0:
panda/src/movies/wavAudioCursor.cxx: In member function ‘virtual void WavAudioCursor::seek(double)’:
panda/src/movies/wavAudioCursor.cxx:301:74: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: [enabled by default]
In file included from /usr/include/c++/4.7/iosfwd:42:0,
                 from /usr/include/c++/4.7/ios:39,
                 from /usr/include/c++/4.7/ostream:40,
                 from /usr/include/c++/4.7/iostream:40,
                 from built/include/dtoolbase_cc.h:54,
                 from built/include/dtoolbase.h:422,
                 from built/include/pandabase.h:22,
                 from panda/src/movies/config_movies.h:18,
                 from panda/src/movies/config_movies.cxx:15,
                 from panda/src/movies/p3movies_composite1.cxx:1:
/usr/include/c++/4.7/bits/postypes.h:180:7: note: candidate 1: std::fpos<_StateT> std::fpos<_StateT>::operator+(std::streamoff) const [with _StateT = __mbstate_t; std::fpos<_StateT> = std::fpos<__mbstate_t>; std::streamoff = long int]
In file included from panda/src/movies/p3movies_composite1.cxx:16:0:
panda/src/movies/wavAudioCursor.cxx:301:74: note: candidate 2: operator+(std::streamoff {aka long int}, long unsigned int) <built-in>

So basically this seems to be resolved. Even though, I think it would be nice to avoid the warning.

Unfortunately, however, the build does now fail at a new file: panda/src/glxdisplay/p3glxdisplay_composite1.cxx:

In file included from panda/src/glxdisplay/p3glxdisplay_composite1.cxx:3:0:
panda/src/glxdisplay/glxGraphicsPipe.cxx: In member function ‘virtual PointerTo<GraphicsOutput> glxGraphicsPipe::make_output(const string&, const FrameBufferProperties&, const WindowProperties&, int, GraphicsEngine*, GraphicsStateGuardian*, GraphicsOutput*, int, bool&)’:
panda/src/glxdisplay/glxGraphicsPipe.cxx:177:44: error: expected ‘)’ before ‘{’ token
panda/src/glxdisplay/glxGraphicsPipe.cxx:205:42: error: expected ‘)’ before ‘{’ token
The following command returned a non-zero value: g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/p3glxdisplay_composite1.o -Ibuilt/tmp -Ibuilt/include -I/usr/include/python2.7 -I/usr/include/libdrm -Ipanda/src/glxdisplay -pthread -O2 -DBUILDING_PANDAGL panda/src/glxdisplay/p3glxdisplay_composite1.cxx
Storing dependency cache.

Seems to be a simple syntax issue.

Oops, that is my fault as well. Looks like that has been there for a while. Checked in a fix. My apologies.

Great! Works now :slight_smile: