Quazip在Mac 10.9, Qt 5.4和clang(64位)上抛出错误
Quazip throws an error on Mac 10.9, Qt 5.4 and clang(64 bit)
我试图在我的Qt 5.4项目中使用Quazip 0.7.1(使用clang在同一台机器上使用Qt 5.4编译)来压缩存档中的文件。代码在使用MSVC 2012编译器的Windows上工作良好,但是相同的代码在Mac OSX上崩溃,错误为QIODevice::open file access not specified
。下面是我的代码片段。
bool Utils::Archive(QList<QString> arrFiles, QString strFileName)
{
QFile zipFile(strFileName);
QuaZip zip(&zipFile);
// CODE CRASHES HERE
if(!zip.open(QuaZip::mdAppend))
{
qWarning("testCreate(): zip.open(): %d", zip.getZipError());
return false;
}
代码在压缩文件上崩溃。打开电话。任何建议/想法将不胜感激。由于
好吧,这是我的代码工作得很好,从比较它到你的im调用打开Quazip对象之前的Quazip文件也许尝试像我说它对我有用。我使用mdCreate,但我确定这也适用于mdappend
// Create new zip file to store the file.
auto zip_file(new QuaZip(file_path.string().c_str()));
if(zip_file->open(QuaZip::mdCreate))
{
QuaZipFile file(zip_file);
if(file.open(QIODevice::WriteOnly, QuaZipNewInfo("something.xml")) == false)
{
// Error
}
else
{
// Do stuff...
}
相关文章:
- 将应用程序从32位移植到64位时出现问题
- 64位机器上的C++内存对齐
- qmake:检测目标位宽(32 位或 64 位)
- 如何在 64 位 vb.net Windows 应用程序中引用 32 位 dll
- Qt 5.11.2 (Clang 8.0 (Apple), 64 位), 找不到 QJSEngine 文件
- 在 64 位边界上对齐C++结构数组?
- 如何为字符串生成唯一但一致的 N 位哈希(小于 64 位)?
- 在 64 位的 c++ 中运行 mstest 测试
- 在两个线程上读/写 64 位,无互斥/锁定/原子
- 浮点数为 32 位和 64 位二进制表示形式
- 是否有 64 位等效于 GetLastInputInfo / LASTINPUTINFO?
- 所有可能的链接生成器与64位密钥
- WinAPI C++如何从 64 位应用程序加载资源
- 在 c++ 中输出 64 位整数
- 如何在 32 位 Ubuntu 18.04 上使用 64 位 clang v8 构建 libc++
- 我想在Windows上使用Clang从C++编译64位代码-找不到stdio.h文件
- 使用Clang编译时,Linker无法在64位Mint操作系统下找到32位库
- 在windows 8.1上使用clang cl 64位
- Mac 10.9使用Qt 5.4和Clang(64位)时出现Zipios错误
- Quazip在Mac 10.9, Qt 5.4和clang(64位)上抛出错误