Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我在Apple M1芯片的电脑上能成功运行程序,但是不能完成转换,没有错误提示。 #9

Open
mcleolee opened this issue Jan 15, 2023 · 11 comments
Labels
bug Something isn't working help wanted Extra attention is needed macOS Specific to macOS

Comments

@mcleolee
Copy link

您好作者,感谢开发。在Apple M1芯片的电脑上能成功运行程序,但是不能完成转换,没有错误提示。
截屏2023-01-15 20 11 41

@sainnhe
Copy link
Owner

sainnhe commented Jan 15, 2023

方便上传样本吗?或者给我发邮件也行。

@mcleolee
Copy link
Author

CAJ文件不支持传输,我压缩了发给您。
智能交通系统车辆流量检测技术的研究_代建辉.caj.zip

@sainnhe
Copy link
Owner

sainnhe commented Jan 15, 2023

a.pdf

刚刚试了一下,命令行和 Windows 版的程序都可以正常转换,估计是 macOS 共享库的问题,我排查一下。

@sainnhe sainnhe added bug Something isn't working macOS Specific to macOS labels Jan 15, 2023
@mcleolee
Copy link
Author

多谢!

@sainnhe
Copy link
Owner

sainnhe commented Jan 15, 2023

这个 Bug 很迷,从命令行启动程序就可以正常转换,你可以试试打开终端,执行这条命令:

/Applications/caj2pdf.app/Contents/MacOS/caj2pdf

我不是 macOS 开发者,所以不清楚从命令行启动和从启动器启动有啥区别,希望有知道的开发者可以解答一下。

@sainnhe sainnhe added the help wanted Extra attention is needed label Jan 15, 2023
sainnhe added a commit that referenced this issue Jan 15, 2023
@sainnhe
Copy link
Owner

sainnhe commented Jan 15, 2023

已更新 README ,这条作为临时的解决方案吧。

@mcleolee
Copy link
Author

我试着从终端启动程序并转换,成功了。看来只能写个shell来启动了,真是很奇怪的bug啊。

@mcleolee
Copy link
Author

不过在终端有这样一条消息,应该是父子线程问题,可以注意一下。另外,我觉得您博客做的很好!

QObject: Cannot create children for a parent that is in a different thread.
(Parent is CAJ2PDF(0x3099392c8), parent's thread is QThread(0x60000273c1e0), current thread is ExecutionThread(0x60000300b0c0)

@sainnhe
Copy link
Owner

sainnhe commented Jan 15, 2023

不过在终端有这样一条消息,应该是父子线程问题,可以注意一下。另外,我觉得您博客做的很好!

QObject: Cannot create children for a parent that is in a different thread.
(Parent is CAJ2PDF(0x3099392c8), parent's thread is QThread(0x60000273c1e0), current thread is ExecutionThread(0x60000300b0c0)

这个提示我之前就注意到了,原因是我把转换线程放在一个子线程(控制线程)中创建了,而一般来讲所有线程的创建都应该放在主线程中。我尝试过不止一次按照官方的思路用 signals & slots 来把转换线程放在主线程中创建,但全部失败了。失败的原因主要是互斥锁在不同的线程间无法同步。

这个提示在 Windows 和 Linux 下也有,但我发现它其实并不影响实际的功能,所以就没管它了,把它当成一个 Warning 好了。

顺便一提,我个人的猜测是,它之所以不影响是因为 Qt 的实现可能是如果新线程是在某个子线程中创建的,那就 fallback 到主线程中创建并报出这个提示,而由于在这个程序的实现中,转换线程并不需要共享控制线程的资源,所以没有报错。

@7scc
Copy link

7scc commented Apr 22, 2023

我也是M1,遇到了同样的问题。输出目录自定义在Download,每次手动改成desktop就能成功转换了。

@cherrywz
Copy link

cherrywz commented Nov 3, 2023

我是mac m1 用户, 只有部分文件能转换。 不能转换的文件报错为File is pure-text HN; cannot convert to pdf, 不知道是我自己文件的问题还是别的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed macOS Specific to macOS
Projects
None yet
Development

No branches or pull requests

4 participants