undefined reference to `<クラス名>::<シグナル名>'
問題
シグナルを定義してビルドすると下記のエラーが発生する。
undefined reference to `<クラス名>::<シグナル名>'
原因
クラス定義に Q_OBJECT キーワードを記述していないため。
対策
クラス定義に Q_OBJECT キーワードを記述する。
class MyClass { Q_OBJECT ... signals: void MySignal(); ... }
参考文献
ウィンドウ名からウィンドウ ID を得る
- xwininfo コマンドを使う。
xwininfo -name NAME
- wmctrl コマンドの結果をフィルターする。
wmctrl -l | grep "NAME"
ERROR: ExpansionError during parsing ...: Failure expanding variable do_unpack: SyntaxError: invalid syntax ...
問題
レシピに do_unpack_append を追加すると、do_unpack 実行時にエラーになる。
レシピ:
do_unpack_append(){ rm obstacle.file }
エラー:
ERROR: ExpansionError during parsing ...: Failure expanding variable do_unpack: SyntaxError: invalid syntax ...
原因
内容が Python で書かれていないため。
do_unpack は Python 関数のため、do_unpack_append も Python で記述する必要がある。
対処
Python で書く。
do_unpack_append(){ os.remove("obstacle.file") }
objcopy failed with exit code 256 ...: File format not recognized
問題
package タスクが次のエラーで失敗する。
ERROR: objcopy failed with exit code 256 (cmd was 'arm-poky-linux-gnueabi-objcopy' --only-keep-debug '/path/to/workdir/package/usr/bin/example' '/path/to/workdir/package/usr/bin/.debug/example'): arm-poky-linux-gnueabi-objcopy:/path/to/workdir/package/usr/bin/example: File format not recognized ERROR: Function failed: split_and_strip_files ERROR: Logfile of failure stored in: /path/to/workdir/temp/log.do_package.12345 ERROR: Task 10 (/path/to/recipe/example_0.1.bb, do_package) failed with exit code '1'
原因
ソースの tar ボールにセルフビルドした時の実行ファイルが含まれていたため。
対処
tar ボールからセルフビルド向けファイルを削除した。
タスクの一覧を表示する方法
bitbake コマンドで listtasks タスクを実行する。
なお、表示されたタスクが実行されるとは限らないようだ。
$ bitbake -c listtasks <レシピ名>
$ bitbake -c listtasks core-image-minimal do_build Default task for a recipe - depends on all other normal tasks required to 'build' a recipe do_bundle_initramfs Combines an initial ramdisk image and kernel together to form a single image do_checkuri Validates the SRC_URI value do_checkuriall Validates the SRC_URI value for all recipes required to build a target do_clean Removes all output files for a target do_cleanall Removes all output files, shared state cache, and downloaded source files for a target do_cleansstate Removes all output files and shared state cache for a target do_compile Compiles the source in the compilation directory do_configure Configures the source by enabling and disabling any build-time and configuration options for the software being built do_devshell Starts a shell with the environment set up for development/debugging do_fetch Fetches the source code do_fetchall Fetches all remote sources required to build a target do_install Copies files from the compilation directory to a holding area do_listtasks Lists all defined tasks for a target do_package Analyzes the content of the holding area and splits it into subsets based on available packages and files do_package_setscene Analyzes the content of the holding area and splits it into subsets based on available packages and files (setscene version) do_package_write_rpm Creates the actual RPM packages and places them in the Package Feed area do_package_write_rpm_setscene Creates the actual RPM packages and places them in the Package Feed area (setscene version) do_packagedata Creates package metadata used by the build system to generate the final packages do_packagedata_setscene Creates package metadata used by the build system to generate the final packages (setscene version) do_patch Locates patch files and applies them to the source code do_populate_lic Writes license information for the recipe that is collected later when the image is constructed do_populate_lic_setscene Writes license information for the recipe that is collected later when the image is constructed (setscene version) do_populate_sdk Creates the file and directory structure for an installable SDK do_populate_sysroot Copies a subset of files installed by do_install into the sysroot in order to make them available to other recipes do_populate_sysroot_setscene Copies a subset of files installed by do_install into the sysroot in order to make them available to other recipes (setscene version) do_rootfs Creates the root filesystem (file and directory structure) for an image do_unpack Unpacks the source code into a working directory NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and all succeeded.
X11 で ウィンドウ ID の一覧を得る方法
wmctrl コマンドを使う。
$ wmctrl -l
xwininfo コマンドを使う。
$ xwininfo -root -tree
Unknown module(s) in QT: script
問題
.pro に "QT += declarative" を記述すると、script モジュールのエラーになる。
Unknown module(s) in QT: script
環境
- Ubuntu 14.04 LTS 64bit + Qt 5.2.1
- Raspbian 8.0 + Qt 5.3.2
解決方法
qtscript5-dev パッケージをインストールする。
$ sudo apt-get install qtscript5-dev