Skip to content

error: no member named 'make_unique' in namespace 'std' #114

@ryandesign

Description

@ryandesign

Compiling enigma (latest git source as of yesterday) on macOS 12 fails:

main.cc:885:77: error: no member named 'make_unique' in namespace 'std'
    nls::theDictionaryManager.reset(new tinygettext::DictionaryManager(std::make_unique<nls::TinyGetTextFileSystem>(), "UTF-8"));
                                                                       ~~~~~^
main.cc:885:115: error: expected '(' for function-style cast or type construction
    nls::theDictionaryManager.reset(new tinygettext::DictionaryManager(std::make_unique<nls::TinyGetTextFileSystem>(), "UTF-8"));
                                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~^
main.cc:885:117: error: expected expression
    nls::theDictionaryManager.reset(new tinygettext::DictionaryManager(std::make_unique<nls::TinyGetTextFileSystem>(), "UTF-8"));
                                                                                                                    ^

This is because the configure script has determined that compiler flags should include -std=gnu++11 -std=c++14 -std=gnu++11, putting the compiler into C++11 mode even though C++14 mode is needed to use std::make_unique:

checking for ccache /usr/bin/clang++ option to enable C++11 features... -std=gnu++11
checking dependency style of ccache /usr/bin/clang++ -std=gnu++11... gcc3
checking whether ccache /usr/bin/clang++ -std=gnu++11 supports C++14 features with -std=c++14... yes
checking for gcc... (cached) ccache /usr/bin/clang
checking whether the compiler supports GNU C... (cached) yes
checking whether ccache /usr/bin/clang accepts -g... (cached) yes
checking for ccache /usr/bin/clang option to enable C11 features... (cached) none needed
checking whether ccache /usr/bin/clang understands -c and -o together... (cached) yes
checking dependency style of ccache /usr/bin/clang... (cached) gcc3
checking whether the compiler supports GNU C++... (cached) yes
checking whether ccache /usr/bin/clang++ -std=gnu++11 -std=c++14 accepts -g... (cached) yes
checking for ccache /usr/bin/clang++ -std=gnu++11 -std=c++14 option to enable C++11 features... (cached) -std=gnu++11
checking dependency style of ccache /usr/bin/clang++ -std=gnu++11 -std=c++14 -std=gnu++11... (cached) gcc3

If I manually put -std=c++14 in CXXFLAGS before configuring, the build succeeds since configure then determines:

checking for ccache /usr/bin/clang++ option to enable C++11 features... none needed

I used ./autogen.sh prior to running ./configure and make. I am using:

% autoconf --version
autoconf (GNU Autoconf) 2.72
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<https://gnu.org/licenses/gpl.html>, <https://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.
% automake --version
automake (GNU automake) 1.18.1
Features: subsecond-mtime

Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later
  <https://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Tom Tromey <tromey@redhat.com>
       and Alexandre Duret-Lutz <adl@gnu.org>.

The problem does not affect the source release of enigma 1.30 since its configure script was generated with an older autoconf that doesn't check for how to enable C++11 mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions