stevenlovegrove / Pangolin

Pangolin is a lightweight portable rapid development library for managing OpenGL display / interaction and abstracting video input.
MIT License
2.38k stars 854 forks source link

cmake failed: In function ‘pangolin::GlGeometry::Element pangolin::ToGlGeometryElement(const pangolin::Geometry::Element&, pangolin::GlBufferType)’: #453

Closed saravanabalagi closed 3 years ago

saravanabalagi commented 5 years ago
Scanning dependencies of target pangolin
[  1%] Building CXX object src/CMakeFiles/pangolin.dir/utils/sigstate.cpp.o
[  2%] Building CXX object src/CMakeFiles/pangolin.dir/utils/timer.cpp.o
[  3%] Building CXX object src/CMakeFiles/pangolin.dir/utils/threadedfilebuf.cpp.o
[  4%] Building CXX object src/CMakeFiles/pangolin.dir/utils/file_extension.cpp.o
[  5%] Building CXX object src/CMakeFiles/pangolin.dir/utils/file_utils.cpp.o
[  6%] Building CXX object src/CMakeFiles/pangolin.dir/utils/uri.cpp.o
[  7%] Building CXX object src/CMakeFiles/pangolin.dir/image/image_io_zstd.cpp.o
[  8%] Building CXX object src/CMakeFiles/pangolin.dir/image/image_io_jpg.cpp.o
[  9%] Building CXX object src/CMakeFiles/pangolin.dir/image/image_io_tga.cpp.o
[ 10%] Building CXX object src/CMakeFiles/pangolin.dir/image/pixel_format.cpp.o
[ 11%] Building CXX object src/CMakeFiles/pangolin.dir/image/image_io_pango.cpp.o
[ 12%] Building CXX object src/CMakeFiles/pangolin.dir/image/image_io_exr.cpp.o
[ 13%] Building CXX object src/CMakeFiles/pangolin.dir/image/image_io.cpp.o
[ 14%] Building CXX object src/CMakeFiles/pangolin.dir/image/image_io_raw.cpp.o
[ 15%] Building CXX object src/CMakeFiles/pangolin.dir/image/image_io_lz4.cpp.o
[ 16%] Building CXX object src/CMakeFiles/pangolin.dir/image/image_io_packed12bit.cpp.o
[ 17%] Building CXX object src/CMakeFiles/pangolin.dir/image/image_io_ppm.cpp.o
[ 18%] Building CXX object src/CMakeFiles/pangolin.dir/image/image_io_png.cpp.o
[ 19%] Building CXX object src/CMakeFiles/pangolin.dir/log/packetstream_writer.cpp.o
[ 20%] Building CXX object src/CMakeFiles/pangolin.dir/log/playback_session.cpp.o
[ 21%] Building CXX object src/CMakeFiles/pangolin.dir/log/packetstream.cpp.o
[ 22%] Building CXX object src/CMakeFiles/pangolin.dir/log/packetstream_reader.cpp.o
[ 23%] Building CXX object src/CMakeFiles/pangolin.dir/log/packet.cpp.o
[ 24%] Building CXX object src/CMakeFiles/pangolin.dir/geometry/glgeometry.cpp.o
/home/saravanabalagi/Projects/Python/Pangolin/src/geometry/glgeometry.cpp: In function ‘pangolin::GlGeometry::Element pangolin::ToGlGeometryElement(const pangolin::Geometry::Element&, pangolin::GlBufferType)’:
/home/saravanabalagi/Projects/Python/Pangolin/src/geometry/glgeometry.cpp:38:26: error: parameter declared ‘auto’
         visit([&](auto&& attrib){
                          ^
/home/saravanabalagi/Projects/Python/Pangolin/src/geometry/glgeometry.cpp: In lambda function:
/home/saravanabalagi/Projects/Python/Pangolin/src/geometry/glgeometry.cpp:39:23: error: expected type-specifier
             using T = std::decay_t<decltype(attrib)>;
                       ^
/home/saravanabalagi/Projects/Python/Pangolin/src/geometry/glgeometry.cpp:41:67: error: template argument 1 is invalid
             glattrib.gltype = GlFormatTraits<typename T::PixelType>::gltype;
                                                                   ^
/home/saravanabalagi/Projects/Python/Pangolin/src/geometry/glgeometry.cpp:42:42: error: ‘attrib’ was not declared in this scope
             glattrib.count_per_element = attrib.w;
                                          ^
.
.
.
/home/saravanabalagi/Projects/Python/Pangolin/include/mpark/variant.hpp:2345:34: note: template<class Visitor, class ... Vs> constexpr decltype (((mpark::detail::all(mpark::lib::cpp14::array<bool, sizeof (Vs ...)>{{!mpark::visit::vs.valueless_by_exception()...}}) ? (void)(0) : mpark::throw_bad_variant_access()), mpark::detail::visitation::variant::visit_value(forward<Visitor>(visitor), (forward<Vs>)(mpark::visit::vs)...))) mpark::visit(Visitor&&, Vs&& ...)
   inline constexpr DECLTYPE_AUTO visit(Visitor &&visitor, Vs &&... vs)
                                  ^
/home/saravanabalagi/Projects/Python/Pangolin/include/mpark/variant.hpp:2345:34: note:   substitution of deduced template arguments resulted in errors seen above
make[2]: *** [src/CMakeFiles/pangolin.dir/geometry/glgeometry.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/pangolin.dir/all] Error 2
make: *** [all] Error 2

Complete output here: output.log

OS: Ubuntu 14.04 cmake: 3.2.2 python: 3.6.7

-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Build type not set (defaults to release)
-DCMAKE_BUILD_TYPE=Debug for debug
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26") 
-- Eigen Found and Enabled
-- libdc1394 Found and Enabled
-- V4L Found and Enabled
-- Performing Test HAVE_FFMPEG_MAX_ANALYZE_DURATION
-- Performing Test HAVE_FFMPEG_MAX_ANALYZE_DURATION - Success
-- Performing Test HAVE_FFMPEG_AVFORMAT_ALLOC_OUTPUT_CONTEXT2
-- Performing Test HAVE_FFMPEG_AVFORMAT_ALLOC_OUTPUT_CONTEXT2 - Failed
-- Performing Test HAVE_FFMPEG_AVPIXELFORMAT
-- Performing Test HAVE_FFMPEG_AVPIXELFORMAT - Success
-- ffmpeg Found and Enabled
-- LibRealSense Found and Enabled
-- OpenNI Found and Enabled
-- OpenNI2 Found and Enabled
-- libpng Found and Enabled
-- libjpeg Found and Enabled
-- libtiff Found and Enabled
-- libopenexr Found and Enabled
-- libzstd Found and Enabled
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.6") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/saravanabalagi/Projects/Python/Pangolin/build

Did a git clone and followed instructions How do I fix the error?

stevenlovegrove commented 5 years ago

When did you last pull? This is a compiler bug - a workaround made it into Pangolin just yesterday, I think:

https://github.com/stevenlovegrove/Pangolin/commit/0d676304fa8fb8f83d3b4224d550e6da7e3c9e52

try a git pull.

saravanabalagi commented 5 years ago

I had the error after the 0d67630 update, but just to make sure if I am using the updated version, I did a git pull again, the commit hash changed from 0d67630 to 611edbd and the compilation failed again at 24% with the same error.

b51 commented 5 years ago

I got exactly the same error, my environment: ubuntu 14.04, cmake 3.2.2, gcc & g++ 4.8.5. And I fixed this error by upgrade gcc & g++ from 4.8.5 -> 5.5.0.