fmang / opustags

Ogg Opus tags editor
BSD 3-Clause "New" or "Revised" License
81 stars 11 forks source link

make install : opustags/src/cli.cc:13:0: error: ‘make_unique’ is not a member of ‘std’ #23

Closed sebma closed 5 years ago

sebma commented 5 years ago

Hi,

I have a pb. with sudo make install :

$ sudo make install
[sudo] password for xyztabcd:              
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xyztabcd/src/opustags/build
Scanning dependencies of target libopustags
[ 20%] Building CXX object CMakeFiles/libopustags.dir/src/cli.cc.o
In file included from /home/xyztabcd/src/opustags/src/cli.cc:13:0:
/home/xyztabcd/src/opustags/src/opustags.h: In constructor ‘ot::dynamic_ogg_packet::dynamic_ogg_packet(size_t)’:
/home/xyztabcd/src/opustags/src/opustags.h:271:10: error: ‘make_unique’ is not a member of ‘std’
   data = std::make_unique<unsigned char[]>(size);
          ^
/home/xyztabcd/src/opustags/src/opustags.h:271:27: error: expected primary-expression before ‘unsigned’
   data = std::make_unique<unsigned char[]>(size);
                           ^
/home/xyztabcd/src/opustags/src/opustags.h:271:27: error: expected ‘;’ before ‘unsigned’
/home/xyztabcd/src/opustags/src/cli.cc: In function ‘ot::status ot::run(ot::options&)’:
/home/xyztabcd/src/opustags/src/cli.cc:310:13: error: ‘make_unique’ is not a member of ‘std’
    writer = std::make_unique<ot::ogg_writer>(output.get());
             ^
/home/xyztabcd/src/opustags/src/cli.cc:310:44: error: expected primary-expression before ‘>’ token
    writer = std::make_unique<ot::ogg_writer>(output.get());
                                            ^
make[2]: *** [CMakeFiles/libopustags.dir/src/cli.cc.o] Error 1
make[1]: *** [CMakeFiles/libopustags.dir/all] Error 2
make: *** [all] Error 2

Can you help me ?

fmang commented 5 years ago

The compiler you're using is too old. Run c++ --version and which c++ to see what you've got.

If you're on an LTS version, building with clang might be a simpler option than upgrading g++. Just add -DCMAKE_CXX_COMPILER=clang++ to the cmake invocation, provided you have clang installed.

By the way, it's better practice to run make first without sudo, and then sudo make install.

sebma commented 5 years ago
$ c++ --version
c++ (Ubuntu 4.8.5-4ubuntu8~14.04.2) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Yes I'm using an LTS, that's why the compiler is old.

I also have gcc-7 already installed from the ppa:ubuntu-toolchain-r/test launchpad repository , I've tried -DCMAKE_CXX_COMPILER=g++-7and it worked !

Thanks a lot.

God bless you abundantly !