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

请问版本兼容性是那些? #16

Open
cnorgnfz opened this issue Jul 14, 2023 · 17 comments
Open

请问版本兼容性是那些? #16

cnorgnfz opened this issue Jul 14, 2023 · 17 comments

Comments

@cnorgnfz
Copy link

QT5的版本多少,Cubism SDK for Native,版本的,好像很容易存在不兼容问题

@Arkueid
Copy link
Owner

Arkueid commented Jul 14, 2023

QT的版本是5.15.2,Cubism SDK for Native 版本是4-r.6.1,没怎么考虑兼容性,我都选了常用的版本。只用 glfw 和 glew 貌似也会出现透明度的问题#12。SDK 目前不能加载 Cubism 2.0 及以前的模型,适用于 Unity 的模型虽然能加载但可能会出现图层顺序错乱的问题(类似穿模?)。

@cnorgnfz
Copy link
Author

好的谢谢, glfw 和 glew有没有版本要求?

@Arkueid
Copy link
Owner

Arkueid commented Jul 14, 2023

我用的是 glew 2.2.0、glfw 3.3.8,版本跨度不大的话应该没问题。

@cnorgnfz
Copy link
Author

live2D的4的6版本中用到了openGLE2?好像里面有用到lg.h的跟这个gle2的lg2.h有冲突

@Arkueid
Copy link
Owner

Arkueid commented Jul 14, 2023

这方面我也不太懂,有具体的报错信息吗

@cnorgnfz
Copy link
Author

类似这种错,严重性 代码 说明 项目 文件 行 禁止显示状态
错误 LNK2019 无法解析的外部符号 glfwInit,函数 "public: bool __cdecl LAppDelegate::Initialize(class GLWidget *)" (?Initialize@LAppDelegate@@QEAA_NPEAVGLWidget@@@z) 中引用了该符号 Project1 C:\my-rjdata\vsObj\Project1\LAppDelegate.obj 1

严重性 代码 说明 项目 文件 行 禁止显示状态
错误 LNK2001 无法解析的外部符号 "public: virtual struct QMetaObject const * __cdecl ConversationWidget::metaObject(void)const " (?metaObject@ConversationWidget@@UEBAPEBUQMetaObject@@xz) Project1 C:\my-rjdata\vsObj\Project1\ChatWidget.obj 1

@Arkueid
Copy link
Owner

Arkueid commented Jul 15, 2023

无法解析外部符号是因为源码中引用了静态库的相关定义,但是链接该静态库时出现了错误,可能原因有两个:

  1. 在链接静态库的时候找不到静态库(.lib)中的相关定义
  2. 找不到该静态库
    对于 1,把 Demo.dir,Framework.dir 这类中间生成目录删除,然后尝试重新生成整个项目;对于 2,需要检查生成静态库的路径和对应项目中的引用路径是否一致。

第一段的 glfwInit 可能是文件路径的问题,克隆下来后,文件名和项目文件最好不要移动或者重命名。如果改动的话在相关项目属性中也要改动,比较麻烦。

第二段的 "public: virtual struct QMetaObject const * ..." 应该是相关源文件文件(ChatWidget.cpp 和 ChatWiget.hpp)被改动,但是 moc_XXXX.cpp 文件没有更新,moc 文件需要通过 moc.exe 生成(QT 安装目录下可以找到),源码文件夹中的 gen_moc.bat 就是由于生成 moc 文件的脚本。

@cnorgnfz
Copy link
Author

好的,谢了,现在又有其他问,捂脸.....严重性 代码 说明 项目 文件 行 禁止显示状态
错误 LNK2001 无法解析的外部符号 "public: __cdecl Json::Value::Value(enum Json::ValueType)" (??0Value@Json@@qeaa@W4ValueType@1@@z) Demo C:\my_cpp_lib\CubismSdkForNative-4-r.6\Samples\OpenGL\Demo\proj.win.cmake\build\proj_msvc2022_x64_mt\NetworkUtils.obj 1
,我路径也配置好了C:\vcpkg-2023.06.20\installed\x86-windows\lib\jsoncpp.lib,还是报这个,本地想要跑起来好艰难呢捂脸

@Arkueid
Copy link
Owner

Arkueid commented Jul 17, 2023

这个应该是 jsoncpp.cpp 源码文件找不到了,jsoncpp.cpp 和其他源文件放在一起的,在项目里面添加现有项应该就行,其他类似的错误应该可以再考虑一下源文件的路径。话说,你是直接用 Cubism 官方的 SDK 从头开始的吗(看路径好像是

@cnorgnfz
Copy link
Author

是的,重头配置,因为仓库里的只有源代码,很多环境配置,都在编译的时候报错,摸索中,也按你说的那几个版本保持一致在弄.本地确实问题. jsoncpp.cpp 在源代码里没有,只有看到json/json.h与json-forwards.h ,(用的OpenGL)

@Arkueid
Copy link
Owner

Arkueid commented Jul 17, 2023

哈哈,直接从源码开始确实很麻烦(原来之前问版本是这个意思,没理解过来,果咩)。虽然但是,其实是有一个 develop 分支放了整个项目的: https://github.com/Arkueid/DesktopLive2D/tree/develop

@cnorgnfz
Copy link
Author

这个解决完了又来一个,....严重性 代码 说明 项目 文件 行 禁止显示状态
错误 LNK2001 无法解析的外部符号 "public: virtual struct QMetaObject const * __cdecl ConversationWidget::metaObject(void)const " (?metaObject@ConversationWidget@@UEBAPEBUQMetaObject@@xz) Demo C:\my_cpp_lib\CubismSdkForNative-4-r.6\Samples\OpenGL\Demo\proj.win.cmake\build\proj_msvc2022_x64_mt\ChatWidget.obj 1
C:\QtNew\5.15.2\msvc2019_64\lib\Qt5Core.lib
C:\QtNew\5.15.2\msvc2019_64\lib\Qt5Widgets.lib
C:\QtNew\5.15.2\msvc2019_64\lib\Qt5Gui.lib
C:\QtNew\5.15.2\msvc2019_64\lib\Qt5Multimedia.lib都添加了的

@Arkueid
Copy link
Owner

Arkueid commented Jul 17, 2023

直接用已经配置好的工程文件吧,直接从源码开始还有几个变量要设置,太麻烦了https://github.com/Arkueid/DesktopLive2D/tree/develop

@cnorgnfz
Copy link
Author

这拉不下来,git下又报错fatal: repository 'https://github.com/Arkueid/DesktopLive2D/tree/develop/' not found,,压缩包下载下来
解决提示已损坏

@Arkueid
Copy link
Owner

Arkueid commented Jul 17, 2023

git clone -b develop https://github.com/Arkueid/DesktopLive2D

@cnorgnfz
Copy link
Author

可以了,请问下,聊天对话框的3个按钮的图标路径都是对的,但是现实白色的方框,图片没加载上去,不知道什么问题,日志打印了路径都是正常找到图标文件,代码段在_Send = new QPushButton();
_Record = new QPushButton();
_History = new QPushButton();
//历史,麦克风,(没有内容发送时)隐藏,回车
QString rsty = QString("QPushButton {border-image: url(").append(LAppConfig::_ModelDir.c_str()).append("/voiceInput.png); } QPushButton:pressed{border-image: url(").append(LAppConfig::_ModelDir.c_str()).append("/voiceInput_active.png)}");
_Record->setStyleSheet(rsty);
Log("rsty=", rsty.toStdString().c_str());
_Send->setStyleSheet(QString("QPushButton {border-image: url(").append(LAppConfig::_ModelDir.c_str()).append("/send.png); } QPushButton:pressed{border-image: url(").append(LAppConfig::_ModelDir.c_str()).append("/send_active.png)}"));
_History->setStyleSheet(QString("QPushButton {border-image: url(").append(LAppConfig::_ModelDir.c_str()).append("/history.png); } QPushButton:pressed{border-image: url(").append(LAppConfig::_ModelDir.c_str()).append("/history_active.png)}"));

@Arkueid
Copy link
Owner

Arkueid commented Jul 17, 2023

不清楚什么原因,之前也有遇到,当时把之间生成目录 XXX.dir 删掉然后重新生成整个解决方案貌似就可以了(感觉有点玄学

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

No branches or pull requests

2 participants