Qt Test で "QObject::startTimer: QTimer can only be used with threads started with QThread" が表示される

メッセージ

QObject::startTimer: QTimer can only be used with threads started with QThread

原因

  • QApplication なし(QTEST_APPLESS_MAIN マクロ)で実行しているため

対処

"QTEST_APPLESS_MAIN" を "QTEST_MAIN" に置き換える

#include <QCoreApplication>
...
QTEST_MAIN(MyTest)

apt install と apt-get source でパッケージのバージョンが違う

環境

Ubuntu 14.04 LTS (trusty)

原因

/etc/apt/sources.list に、アップデートされたパッケージのソース URL が書かれていなかったため。

deb http://security.ubuntu.com/ubuntu/ trusty-security main universe
deb http://jp.archive.ubuntu.com/ubuntu/ trusty-updates main universe

対処

/etc/apt/sources.list に、ソース URL を追記する。

deb http://security.ubuntu.com/ubuntu/ trusty-security main universe
deb-src http://security.ubuntu.com/ubuntu/ trusty-security main universe
deb http://jp.archive.ubuntu.com/ubuntu/ trusty-updates main universe
deb-src http://jp.archive.ubuntu.com/ubuntu/ trusty-updates main universe

smb.conf に "client min protocol = SMB2" を書いたら smbclient が NT_STATUS_INVALID_PARAMETER_MIX で失敗した

$ smbclient -L 192.168.0.1
Enter user's password: 
protocol negotiation failed: NT_STATUS_INVALID_PARAMETER_MIX

原因

  • "client min protocol" に "client max protocol" より新しいプロトコルを指定したため
    • "client max protocol" のデフォルトは "NT1" (Samba 4.3.11)

対処

"client max protocol" も明示する

client max protocol = SMB3
client min protocol = SMB2

参考

smb.conf に "min protocol = SMB2" を書いたら smbclient が NT_STATUS_CONNECTION_RESET エラーで失敗した

$ smbclient -L 192.168.0.1
Enter user's password: 
protocol negotiation failed: NT_STATUS_CONNECTION_RESET

原因

  • "min protocol" と書いていたため
    • "min protocol" は "server min protocol" と同義のため、クライアントの動作には効かない

対処

"client min protocol" と書く

client min protocol = SMB2

/etc/DIR_COLORS が存在しない

問題

/etc/DIR_COLORS を編集しろという記事を見たが、ファイルが存在しない

環境

Debian 6.0.10 (squeeze) i386

原因

/etc/DIR_COLORS を使わないようになっているため

対処

代わりに ~/.dircolors ファイルを使う。

なければ作る。

$ dircolors  -p  > ~/.dircolors

注)~/.dircolors ファイルが在ればこれを、無ければ "dircolors -b" コマンド出力を使うようになっている(~/.bashrc 内)

linux レシピのビルドが "fatal error: linux/compiler-gcc5.h: No such file or directory" で失敗する

環境
原因
  • コンパイラーに gcc 5 を使ったため
    • 現在のバージョンが gcc 5 をサポートしていないため
解決方法
  1. gcc 4 を使う

  2. Linux 3.18 以降を使う

参考文献