[Seek Help] Win平台使用QT6.5.2开发的项目如何在linuxQT6.5.2上编译 Resolved
Tofloor
poster avatar
菰城鸥鹭
deepin
2023-08-18 02:44
Author

引入

在linuxQT6.5.2上创建Qt widgets Application项目模板,选择qmake作为构建系统,生成的项目文件无缺失

编辑界面显示项目文件只有pro,猜测(编译器并未解析pro文件,导致目录加载不全,无法正常编译)

同时打开Win平台项目,同样不能正常载入

是不是还要进行别的环境配置?

版本

开源版QT6.5.2

deepin 20.9

image.png

image.png

安装完成除了关闭了ClangCodeModel插件外,未进行任何环境配置操作

Reply Favorite View the author
All Replies
fax928
deepin
2023-08-18 03:05
#1

.pro文件里检查一下红框的内容有没有。也可以网上复制报错信息问下ai。(我是新手)
image.png

Reply View the author
菰城鸥鹭
deepin
2023-08-18 03:15
#2
fax928

.pro文件里检查一下红框的内容有没有。也可以网上复制报错信息问下ai。(我是新手)
image.png

有,win平台移植的项目都是在Win上正常编译的,同时linux上新建的项目,pro文件必要内容无缺失

image.png

Reply View the author
忘记、过去
deepin
2023-08-18 03:30
#3

菜单栏->工具->选项,里面有编译环境配置,看看是不是 gcc, qmake 之类的都配置好了

Reply View the author
Ziggy
deepin
2023-08-18 04:49
#4

在源码目录qmake -r看看能不能生成makefile

Reply View the author
fuuko
deepin
2023-08-18 06:03
#5

gcc或者clang装了嘛?正确配置qmake路径了嘛?先跑个用QLabel显示hello world的代码试试

Reply View the author
菰城鸥鹭
deepin
2023-08-18 06:08
#6
忘记、过去

菜单栏->工具->选项,里面有编译环境配置,看看是不是 gcc, qmake 之类的都配置好了

奇怪了,23就没有问题,不过不能编译

image.png

Reply View the author
redmibook
deepin
2023-08-18 09:59
#7
sudo apt install g++ cmake extra-cmake-modules
sudo apt install libxcb-xinerama0-dev
sudo apt install libxkbcommon-dev
sudo apt install libx11-dev
sudo apt install libgl1-mesa-dev
sudo apt install libxcb-cursor-dev
sudo ln -sf /usr/lib/x86_64-linux-gnu/libGL.so.1 /usr/lib/libGL.so
Reply View the author
菰城鸥鹭
deepin
2023-08-18 15:39
#8
忘记、过去

菜单栏->工具->选项,里面有编译环境配置,看看是不是 gcc, qmake 之类的都配置好了

没找到😂(现在的界面变了)不过还好在外部中有配置按钮
image.png

image.png

image.png

Reply View the author
菰城鸥鹭
deepin
2023-08-18 15:45
#9
Ziggy

在源码目录qmake -r看看能不能生成makefile

没有找到该命令

同时我发现在新建的项目都没有生成构建目录(即只有下面的项目文件)
image.png

Reply View the author
菰城鸥鹭
deepin
2023-08-18 15:51
#10
fuuko

gcc或者clang装了嘛?正确配置qmake路径了嘛?先跑个用QLabel显示hello world的代码试试

我只通过QT安装程序进行安装,没有安装其他的任何编译程序,应该不会导致SDK等组件共享出错吧,难道deepin还要进行其他的环境配置😂(所有Application(Qt)都不能正常编译,编辑目录仅显示pro文件)

Reply View the author
菰城鸥鹭
deepin
2023-08-18 16:07
#11
redmibook
sudo apt install g++ cmake extra-cmake-modules
sudo apt install libxcb-xinerama0-dev
sudo apt install libxkbcommon-dev
sudo apt install libx11-dev
sudo apt install libgl1-mesa-dev
sudo apt install libxcb-cursor-dev
sudo ln -sf /usr/lib/x86_64-linux-gnu/libGL.so.1 /usr/lib/libGL.so

谢谢,竟然好了👍 看来确实是环境配置的问题,但是QT开源的安装程序为什么会出现环境配置的问题呢confused

Reply View the author
菰城鸥鹭
deepin
2023-08-18 16:14
#12

我突然发现linux QT不支持中文变量,Win QT是支持的😂

Reply View the author
fuuko
deepin
2023-08-18 16:54
#13
菰城鸥鹭

谢谢,竟然好了👍 看来确实是环境配置的问题,但是QT开源的安装程序为什么会出现环境配置的问题呢confused

看来就是基础环境没弄,编译器都没装joy

你是用run文件装的吧,run里面的脚本没写好就会这样,只有deb包才会给你自动解决这些依赖

Reply View the author
菰城鸥鹭
deepin
2023-08-18 17:17
#14
fuuko

看来就是基础环境没弄,编译器都没装joy

你是用run文件装的吧,run里面的脚本没写好就会这样,只有deb包才会给你自动解决这些依赖

是的,官网的run文件缺失真是少见😂

Reply View the author
Ziggy
deepin
2023-08-19 06:49
#15
菰城鸥鹭

没有找到该命令

同时我发现在新建的项目都没有生成构建目录(即只有下面的项目文件)
image.png

qmake不需要root权限执行的,有可能你的qmake装的时候不装在/usr/bin而是在~/.local/bin,这样其他用户状态下就是未安装

Reply View the author
菰城鸥鹭
deepin
2023-08-19 16:30
#16
Ziggy

qmake不需要root权限执行的,有可能你的qmake装的时候不装在/usr/bin而是在~/.local/bin,这样其他用户状态下就是未安装

好的,谢了tail

Reply View the author