我正在Qt(WinSparkle)应用中使用binding for Go。
要从Qt资源设置DSA公钥,我尝试:https://github.com/vslavik/winsparkle/blob/master/examples/qt/mainwindow.cpp#L48
$ ls -l
drwxrwxrwx 1 drone drone 512 Dec 20 23:07 WinSparkle
-rwxrwxrwx 1 drone drone 90 Dec 20 23:05 resources-windows.qrc
$ ls -l WinSparkle/
-rwxrwxrwx 1 drone drone 2234 Dec 20 15:31 dsa_pub.pem
resources-windows.qrc:
<RCC>
<qresource>
<file>WinSparkle/dsa_pub.pem</file>
</qresource>
</RCC>
我的cgo标头:
/*
#cgo CPPFLAGS: -I ${SRCDIR}/WinSparkle/include
#cgo LDFLAGS: -L${SRCDIR}/WinSparkle/Release -lWinSparkle
#include <QResource>
#include "winsparkle.h"
void initWinSparkle()
{
win_sparkle_set_dsa_pub_pem(reinterpret_cast<const char *>(QResource(":/WinSparkle/dsa_pub.pem").data()));
win_sparkle_init();
}
*/
但出现以下错误:
2018/12/20 08:29:15。\ main_windows.go:10:21:致命错误:QResource:没有这样的文件或目录
为什么?