monostream / tifig

A fast HEIF image converter aimed at thumbnailing
Apache License 2.0
408 stars 50 forks source link

Install Error - Local Variable 't' #59

Open ghost opened 5 years ago

ghost commented 5 years ago

Attempting to install on Mac OS Catalina with latest git clone:

mkdir tifig/build cd tifig/build && cmake ..

-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/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: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
-- Checking for module 'libavcodec'
--   Found libavcodec, version 58.54.100
-- Checking for module 'libavutil'
--   Found libavutil, version 56.31.100
-- Checking for module 'libswscale'
--   Found libswscale, version 5.5.100
-- Checking for module 'vips-cpp'
--   Found vips-cpp, version 8.8.3
-- System name       : Darwin
-- Project Name      : HEIF
-- Project directory : /Users/eunancamilleri/git/tifig/lib/heif
-- Executables in    : /Users/eunancamilleri/git/tifig/lib/heif/Bins
-- File-list         :
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Success
-- Performing Test COMPILER_SUPPORTS_CXX0X
-- Performing Test COMPILER_SUPPORTS_CXX0X - Success
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Configuring done
-- Generating done
-- Build files have been written

then make results in the following output:

Scanning dependencies of target json
[ 96%] Building CXX object lib/heif/Srcs/jsonlib/CMakeFiles/json.dir/jsoncpp.cpp.o
[ 97%] Linking CXX static library libjson.a
/Library/Developer/CommandLineTools/usr/bin/ar qc libjson.a  CMakeFiles/json.dir/jsoncpp.cpp.o
/Library/Developer/CommandLineTools/usr/bin/ranlib libjson.a
[ 97%] Built target json
Scanning dependencies of target example
[ 98%] Building CXX object lib/cxxopts/src/CMakeFiles/example.dir/example.cpp.o
In file included from tifig/lib/cxxopts/src/example.cpp:27:
tifig/lib/cxxopts/include/cxxopts.hpp:195:12: error: local variable 't' will be copied despite being returned by name
      [-Werror,-Wreturn-std-move]
    return t;
           ^
tifig/lib/cxxopts/include/cxxopts.hpp:909:21: note: in instantiation of function template specialization
      'cxxopts::toLocalString<std::__1::basic_string<char> >' requested here
    , m_help_string(toLocalString(std::move(help_string)))
                    ^
tifig/lib/cxxopts/include/cxxopts.hpp:195:12: note: call 'std::move' explicitly to avoid copying
    return t;
           ^
           std::move(t)
1 error generated.
make[2]: *** [lib/cxxopts/src/CMakeFiles/example.dir/example.cpp.o] Error 1
make[1]: *** [lib/cxxopts/src/CMakeFiles/example.dir/all] Error 2
make: *** [all] Error 2
Shinta commented 4 years ago

I have this problem, did this: Changed return t; for return std::move(t); on lib/cxxopts/include/cxxopts.hpp:195

ishowshao commented 4 years ago

I have this problem, did this: Changed return t; for return std::move(t); on lib/cxxopts/include/cxxopts.hpp:195

it works