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

反复调用latex::init和latex::release会crash #143

Open
karlpy opened this issue Jan 16, 2023 · 10 comments
Open

反复调用latex::init和latex::release会crash #143

karlpy opened this issue Jan 16, 2023 · 10 comments
Labels
compile compile problems

Comments

@karlpy
Copy link

karlpy commented Jan 16, 2023

在windows平台,反复调用latex::init和latex::release时,在第二次调用release会崩溃,有没有解决办法,
还有个问题,mac平台是否支持?

@NanoMichael
Copy link
Owner

你是在 master 分支上吧?建议切换到 openmath 分支(支持 unicode math,支持字体切换,支持 web assembly,虽然还没 release,没有编译和使用文档,但是比起 master 分支要稳定得多),应该就没有这个问题。可以在 https://nanomichael.github.io/MicroTeX/ 上试玩。

macOS QT 和 gtk 都是支持的,所以需要依赖 QT 或者 gtk,但是没有 macOS 的原生支持。

@karlpy
Copy link
Author

karlpy commented Jan 16, 2023

你是在 master 分支上吧?建议切换到 openmath 分支(支持 unicode math,支持字体切换,支持 web assembly,虽然还没 release,没有编译和使用文档,但是比起 master 分支要稳定得多),应该就没有这个问题。可以在 https://nanomichael.github.io/MicroTeX/ 上试玩。

macOS QT 和 gtk 都是支持的,所以需要依赖 QT 或者 gtk,但是没有 macOS 的原生支持。

对, 在master分支, openmath有release版本么, 现在想集成到现有的项目中,项目是跨平台的。 在window上使用latex.lib库, 想在mac平台也有一个类似的静态库或者动态库,应该是你说的原生支持。https://github.com/bitjeep/MicroTeX/tree/macport 我看这个链接,有关于mac的编译。 我跑了win自带的demo, win32_main.cpp中,init()里parse的内容改成中文,显示的是乱码,应该是重新设置字体, 但不知道在哪里设置。请问在哪里修改? openmath分支,microtex-win32-example编译报错,LNK2019 无法解析的外部符号 "__declspec(dllimport) public: static void __cdecl microtex::PlatformFactory::registerFactory(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,class std::unique_ptr<class microtex::PlatformFactory,struct std::default_delete >)" (_imp?registerFactory@PlatformFactory@microtex@@SAXABV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@v?$unique_ptr@VPlatformFactory@microtex@@U?$default_delete@VPlatformFactory@microtex@@@std@@@4@@z),函数 "void __cdecl init(void)" (?init@@yaxxz) 中引用了该符号 microtex-win32-example D:\sourceCode\openmath\MicroTeX\build\example\win32\win32_main.obj 类似这种有几个。

@NanoMichael
Copy link
Owner

NanoMichael commented Jan 16, 2023

目前我回家了手头没有 windows 的机器,你贴一下你的编译参数呢?或者试一下这个编译命令:

cmake ..\
-DBUILD_STATIC=ON \
-DHAVE_LOG=OFF \ 
-DGDI=ON \
-DBUILD_EXAMPLE_WIN32=ON
  • BUILD_STATIC 是否编译为静态库
  • HAVE_LOG 是否开启 log
  • GDI 编译 gdi 图形后端,仅 Windows 系统有效
  • BUILD_EXAMPLE_WIN32 是否编译 win32 示例

@karlpy
Copy link
Author

karlpy commented Jan 16, 2023

目前我回家了手头没有 windows 的机器,你贴一下你的编译参数呢?或者试一下这个编译命令:

cmake ..\
-DBUILD_STATIC=ON \
-DHAVE_LOG=OFF \ 
-DGDI=ON \
-DBUILD_EXAMPLE_WIN32=ON
  • BUILD_STATIC 是否编译为静态库
  • HAVE_LOG 是否开启 log
  • GDI 编译 gdi 图形后端,仅 Windows 系统有效
  • BUILD_EXAMPLE_WIN32 是否编译 win32 示例

image
使用的是cmake 图形界面, 勾选的情况是你提供的参数设置。
master分支的demo , 我是可以测试成功的。
我理解microtex-gdi这个库应该是编译的有问题,microtex-gdi编译出来的是dll库,microtex-win32-example引用gid的库时,应该是没有找到,或者是不是得有个lib库

@NanoMichael NanoMichael added the compile compile problems label Jan 16, 2023
@NanoMichael
Copy link
Owner

这个问题只能年后再解决了 😂

@karlpy
Copy link
Author

karlpy commented Jan 17, 2023

这个问题只能年后再解决了 😂

还想请教个问题,iOS跟android 也是支持的吧。
是不是也得需要QT, 没有原生编译?

@NanoMichael
Copy link
Owner

目前 openmath 分支支持 flutter,master 支持 Android(仓库在这里),iOS 目前还不支持。

@karlpy
Copy link
Author

karlpy commented Jan 17, 2023

目前 openmath 分支支持 flutter,master 支持 Android(仓库在这里),iOS 目前还不支持。

好的, 多谢~
我刚才调试了一下,发现根号字符对应的是p,这个是根据加载不同的字体显示的吗?

@NanoMichael
Copy link
Owner

NanoMichael commented Jan 18, 2023

发现根号字符对应的是p,这个是根据加载不同的字体显示的吗?

在 master 分支上是这样的,openmath 上是对应的字符

@Delsart
Copy link

Delsart commented Mar 18, 2023

目前 openmath 分支支持 flutter,master 支持 Android(仓库在这里),iOS 目前还不支持。

您好,Android版可以更新一下repository吗,jcenter已经弃用了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compile compile problems
Projects
None yet
Development

No branches or pull requests

3 participants