$ g++ --version
g++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Copyright (C) 2019 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.
TL;DR
std::unique_ptrインスタンスの宣言時、 unique_ptr<T> hoge = nullptr のように初期化すると代入演算子で reset() を呼び出すので T の定義をインクルードしなければならない。
$ g++ -std=c++14 main.cpp Fuga.cpp -o unique
In file included from /usr/include/c++/9/memory:80,
from Fuga.h:4,
from main.cpp:1:
/usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp =Hoge]’:
/usr/include/c++/9/bits/unique_ptr.h:292:17: required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr()[with _Tp =Hoge; _Dp =std::default_delete<Hoge>]’
Fuga.h:9:34: required from here
/usr/include/c++/9/bits/unique_ptr.h:79:16: error: invalid application of ‘sizeof’ to incomplete type ‘Hoge’
79 | static_assert(sizeof(_Tp)>0,|
$ cat /etc/lsb-release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=20DISTRIB_CODENAME=ulyana
DISTRIB_DESCRIPTION="Linux Mint 20 Ulyana"
$ bash --version
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
Copyright (C)2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ sheldon init --shell zsh
Initialize new config file `~/.config/sheldon/plugins.toml`? [y/N] y
Initialized ~/.config/sheldon/plugins.toml
# `sheldon` configuration file
# ----------------------------
#
# You can modify this file directly or you can use one of the following
# `sheldon` commands which are provided to assist in editing the config file:
#
# - `sheldon add` to add a new plugin to the config file
# - `sheldon edit` to open up the config file in the default editor
# - `sheldon remove` to remove a plugin from the config file
#
# See the documentation for more https://github.com/rossmacarthur/sheldon#readme
shell = "zsh"
[plugins]
# For example:
#
# [plugins.base16]
# github = "chriskempson/base16-shell"
普通に入れる分には zip があるので解凍して中の実行ファイルを動かせばいいらしいのだが、肝心のファイルが Releases にあるのが見つけられずにしばらく迷っていた。
$ unzip bob-linux-x86_64.zip
$ cd bob-linux-x86_64/
$ chmod u+x bob
$ ./bob
./bob: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./bob)./bob: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./bob)./bob: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./bob)
$ dpkg -l | grep libc6
ii libc6:amd64 2.31-0ubuntu9.14 amd64 GNU C Library: Shared libraries
ii libc6:i386 2.31-0ubuntu9.14 i386 GNU C Library: Shared libraries
ii libc6-dbg:amd64 2.31-0ubuntu9.14 amd64 GNU C Library: detached debugging symbols
ii libc6-dev:amd64 2.31-0ubuntu9.14 amd64 GNU C Library: Development Libraries and Header Files
ii libc6-i386 2.31-0ubuntu9.14 amd64 GNU C Library: 32-bit shared libraries for AMD64
ちょっと古かった。いやしかし、流石に glibc を適当にアップデートして依存関係ブチ壊しとかになったら目も当てられないし、全部調べて丁寧に更新するほどの気力はない。 Bob はまた機会があればということで一旦諦めることにする。
僕はとりあえず知っている曲を片っ端から歌うことにしました。しかし "The world is all one!!" を歌おうとしたときに「ひょっとして世界には自分しかいないのではないか」などと考えてしまい、他のジャンルも歌詞のちょっとした部分が不気味な想像に繋がって、最後にはアンパンマンくらいしか歌えなくなっていました。