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

HW1中documents example的cmakelist编写有误 #15

Open
Momo-Tori opened this issue Aug 24, 2022 · 1 comment
Open

HW1中documents example的cmakelist编写有误 #15

Momo-Tori opened this issue Aug 24, 2022 · 1 comment

Comments

@Momo-Tori
Copy link

USTC_CGr\Homeworks\1_MiniDraw\documents\下的项目编译后报错未发现Widgets目录下的头文件,错误信息如下fatal error C1083: 无法打开包括文件: “QtWidgets/QMainWindow”: No such file or directory

对比编译成功的hello项目并查询Ubpa_AddTarget的定义,发现USTC_CG\Homeworks\1_MiniDraw\documents\example\src\example\CMakeLists.txt有误

Ubpa_AddTarget(MODE "EXE" QT ON LIBS "Qt5::Widgets")中的LIBS应改为LIB

修改后编译通过

@Zinn77
Copy link

Zinn77 commented Jun 2, 2023

谢谢您解决了我编译失败的问题!

但是编译成功后,调试运行又报错:
image

尝试将 QT 安装目录下的动态库文件复制到项目生成的 exe 文件目录下,出现了新的报错:
image

请问有人知道这种情况怎么解决吗?非常感谢!

【更新】问题已解决:配置环境变量时应该让 E:\Qt\...\msvc2017_64\bin 的位置在 \mingw64\bin 的上面,以避免出现 dll 污染的情况(\mingw64\bin 中可能有与 \msvc2017_64\bin 同名的库)。

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