Skip to content

Build: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type #144

@feluxe

Description

@feluxe

Hi, I tried building from master on Arch Linux, which didn't work because of the botan2 dependency (arch is on botan3). Therefore I tried to build with the botan3 branch, where I get this error:

g++  -fstack-protector -m64 -pthread -std=c++20 -D_REENTRANT -O3 -momit-leaf-frame-pointer -D_FILE_OFFSET_BITS=64 -Wall -Wextra -Wpedantic -Wstrict-aliasing -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wzero-as-null-pointer-constant -Wnon-virtual-dtor  -I/usr/include/botan-3 -Ibuild/include/encryptmsg -Ibuild/include/encryptmsg/internal -isystem /tmp/encryptpad_build/deps/stlplus/containers -isystem /tmp/encryptpad_build/deps/plog/include -c src/lib/armor_reader.cpp -o build/obj/lib/lib_armor_reader.o
In file included from src/lib/armor_reader.h:2,
                 from src/lib/armor_reader.cpp:1:
src/lib/memory_stream.h:68:10: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type
   68 |     std::unique_ptr<OutStream> MakeOutStream(SafeVector &cnt);
      |          ^~~~~~~~~~
src/lib/memory_stream.h:10:1: note: ‘std::unique_ptr’ is defined in header ‘<memory>’; this is probably fixable by adding ‘#include <memory>’
    9 | #include "emsg_utility.h"
  +++ |+#include <memory>
   10 |
make[1]: *** [Makefile:169: build/obj/lib/lib_armor_reader.o] Error 1
make[1]: Leaving directory '/tmp/encryptpad_build/deps/libencryptmsg'
make: *** [Makefile:69: /tmp/encryptpad_build/deps/libencryptmsg/build/libencryptmsg.a] Error 2

I tried with qt6 branch as well - same error.

By the suggestion, it looks like an easy fix:

note: ‘std::unique_ptr’ is defined in header ‘’; this is probably fixable by adding ‘#include ’
9 | #include "emsg_utility.h"
+++ |+#include

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions