-
Notifications
You must be signed in to change notification settings - Fork 70
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
windows compile #35
Comments
Thanks a lot for your working on building in Windows, which is asked by many users, however, I have not done it yet due to lack of time, your working is excellent, and I should integrate your change into this project when I have time, thanks again, great job :-) 非常感谢你的改动,在Windows上的编译一直是很多人想要的,我苦于没有时间来作,你的改动解决了Windows上的编译,非常感谢,我有空的时候,会把你的改动集成上去,谢谢。 |
@huakunyang 所以我无法直接为你提供pr,需要你自己做一定的修改,或者可以粘贴我项目中的thirdparty/SummerTTS文件,
的形式提供条件编译
根据我的做法你应该能编译成功,我已经可以稳定的编译成功我的插件,所以提供windows版本的编译结果理论上应该是没有任何问题的 |
再次表示感谢,我会在有空的时候把你的改动合进去。其他想在Windows上使用的,也可以参考这位同学的修改,非常细致。 |
@huakunyang
First of all, thank you very much for creating this project
Because the question I asked a few days ago was not effectively resolved (#33) , I did some research on Windows related compilation
Let me show you the results. This is the effect of compiling this project into the game
2024-01-06.18-04-05.mp4
I will mainly talk about the parts that need to be modified in Windows compilation :
Compilation issues with glog and gflags: The compilation is not proceeding smoothly because your project code is compiled using referenced files. However, Windows compilation requires one of the files specific to Windows. This necessitates some adjustments to the compilation code; otherwise, you will encounter the error mentioned in this link: Successfully run on Windows #5 (comment). If you simply use #include "windows/port.h", you will notice similar errors in other files. The final solution is to treat it as a library compilation and then compile the project, linking it with this library.
Compilation errors and crashes caused by Openfst: Skipping the steps of identifying the problem, the fundamental reason is that the MSVC toolchain, which uses the cl compiler, cannot correctly recognize FST types (such as StdVectorFst), leading to crashes. This is because all type definitions are registered through fst-types, but MSVC cannot link smoothly, resulting in crashes. However, if you adjust the compiler to clang-cl, you won't encounter this problem.
Missing definitions:
3.1. M_PI:
3.2. unistd.h, dirent.h, getopt.c, getopt.h: You need to replace some include code in certain files, such as tts_file_io.cpp, etc.
code.zip
After these adjustments, you should be able to successfully compile the project.
=============================================================================
感觉中国人很多,再讲讲中国话
glog 和 gflags 无法顺利编译:因为你的项目代码中使用的是引用文件的形式进行的编译,但是windows编译需要的是其中一个windows下的文件,这就需要对于编译代码进行一些调整,否则就会出现这个报错Successfully run on Windows #5 (comment) . 如果你单纯的使用# include “windows/port.h” 你会发现其他文件也开始出现相似的报错 :
最后的解决方法:我将其看作一个库编译,然后在编译项目的时候再连接这个库的lib和头文件从其中获得代码编译成dll就可以了
Openfst 引发的编译报错和崩溃:省略发现问题的步骤,根本原因是因为:MSVC工具链使用的cl编译器无法正确的识别FST类型(如StdVectorFst)导致崩溃,因为所有的类型定义是通过fst-types 注册的,但是msvc无法顺利的link,所以会崩溃。但是:如果你将编译器调整成clang-cl就不会有这个问题!
缺失定义:
code.zip
然后你应该就能编译成功项目了
The text was updated successfully, but these errors were encountered: