当前位置: 首页 > news >正文

在openSUSE-Leap-15.6-DVD-x86_64中使用gnome-builder-45.0的基本功能(三)空白Meson工程

在openSUSE-Leap-15.6-DVD-x86_64中使用gnome-builder-45.0的基本功能(三)空白Meson工程

需要安装meson、ninja、cmake、flatpak还有SDK
应用程序——工具——终端
ruhongvnc@localhost:~> su -
密码:
localhost:~ # zypper install meson ninja cmake flatpak
localhost:~ # flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
localhost:~ # flatpak remote-modify flathub --url=https://mirror.sjtu.edu.cn/flathub
参考上海交通大学软件源镜像服务https://mirrors.sjtug.sjtu.edu.cn/docs/flathub
使用flathub.org网站下载是非常缓慢的,改成使用mirror.sjtu.edu.cn/flathub就非常快速了
ruhongvnc@localhost:~> flatpak remotes --show-details
名称 标题 网址 集合标识 子集 筛选器 优先级 选项 … … 主页 图标
flathub Flathub https://mirror.sjtu.edu.cn/flathub - - - 1 system … … https://flathub.org/ https://dl.flathub.org/repo/logo.svg
ruhongvnc@localhost:~> cat /var/lib/flatpak/repo/config
localhost:~ # flatpak list|grep gnome
GNOME Application Platform version 45 org.gnome.Platform 45 system
localhost:~ # gnome-builder --version
GNOME Builder 45.0
系统安装gnome-builder-45就会自动安装对应版本的org.gnome.Platform 45

localhost:~ # flatpak search org.freedesktop |grep -i org.freedesktop.sdk
搜索有什么SDK可以安装
localhost:~ # flatpak install org.freedesktop.Sdk
安装org.freedesktop.Sdk,其中S要大写
Looking for matches…
Similar refs found for ‘org.freedesktop.Sdk’ in remote ‘flathub’ (system):

  1. runtime/org.freedesktop.Sdk/x86_64/20.08
  2. runtime/org.freedesktop.Sdk/x86_64/21.08
  3. runtime/org.freedesktop.Sdk/x86_64/22.08
  4. runtime/org.freedesktop.Sdk/x86_64/23.08
  5. runtime/org.freedesktop.Sdk/x86_64/18.08
  6. runtime/org.freedesktop.Sdk/x86_64/1.6
  7. runtime/org.freedesktop.Sdk/x86_64/24.08
  8. runtime/org.freedesktop.Sdk/x86_64/19.08
  9. runtime/org.freedesktop.Sdk/x86_64/25.08

Which do you want to use (0 to abort)? [0-9]: 9 输入数字9再按回车键

ID Branch Op Remote Download
  1. [✓] org.freedesktop.Platform.GL.default 25.08 i flathub 140.4 MB / 141.4 MB
  2. [✓] org.freedesktop.Platform.GL.default 25.08-extra i flathub 25.2 MB / 141.4 MB
  3. [✓] org.freedesktop.Platform.codecs-extra 25.08-extra i flathub 14.2 MB / 14.4 MB
  4. [✓] org.freedesktop.Sdk.Locale 25.08 i flathub 2.7 MB / 394.4 MB
  5. [✓] org.freedesktop.Sdk 25.08 i flathub 508.3 MB / 595.3 MB

Installation complete.
选择版本数字最高的25.08,耗时大约10分钟,安装后占用2GB空间
localhost:~ # flatpak list
Name Application ID Version Branch Installation
Mesa …desktop.Platform.GL.default 25.3.5 25.08 system
Mesa (Extra) …desktop.Platform.GL.default 25.3.5 25.08-extra system
Codecs Extra Extension …sktop.Platform.codecs-extra 25.08-extra system
Freedesktop SDK org.freedesktop.Sdk freedesktop-sdk-25.08.8 25.08 system
GNOME Application Plat… org.gnome.Platform 45 system

应用程序——编程——构建器——最下方创建新工程——工程名称multiplication_table_meson——应用程序ID:org.example.multiplication_table_meson——模板——空白Meson工程——创建工程
打开src/main.c把它换成以下打印乘法口决multiplication_table的C程序,组合键Ctrl+S保存
ruhongvnc@localhost:~> cat /home/ruhongvnc/工程/multiplication_table_meson/src/main.c

#include"config.h"#include<stdio.h>#include<glib.h>#include<stdlib.h>gintmain(gint argc,gchar*argv[]){inti,j;g_autoptr(GOptionContext)context=NULL;g_autoptr(GError)error=NULL;gboolean version=FALSE;GOptionEntry main_entries[]={{"version",0,0,G_OPTION_ARG_NONE,&version,"Show program version"},{NULL}};context=g_option_context_new("- my command line tool");g_option_context_add_main_entries(context,main_entries,NULL);if(!g_option_context_parse(context,&argc,&argv,&error)){g_printerr("%s\n",error->message);returnEXIT_FAILURE;}if(version){g_printerr("%s\n",PACKAGE_VERSION);returnEXIT_SUCCESS;}printf("9x9 乘法口诀表:\n");for(i=1;i<=9;i++){for(j=1;j<=i;j++){printf("%d*%d=%d\t",j,i,i*j);}printf("\n");// 每打印完一行后换行}returnEXIT_SUCCESS;}

提示安装org.freedesktop.Platform/x86_64/22.08——取消
单击最上方铁锤图标旁边的倒三角图标——配置工程——配置——org.example.multiplication_table_meson——位置——源码树内部——运行时——org.freedesktop.Platform/x86_64/25.08,其实就是修改org.example.multiplication_table_meson.json文件
右上角三根横线——首选项——左下角SDKs——可用SDK
默认或者源码树外部,编译出执行文件存放的路径是
/home/ruhongvnc/.cache/gnome-builder/projects/multiplication_table_meson/builds/org.example.multiplication_table_meson.json-flatpak-org.freedesktop.Platform-25.08-x86_64-main/src/multiplication_table_meson

源码树内部,编译出执行文件存放的路径是
/home/ruhongvnc/工程/multiplication_table_meson/_build/src/multiplication_table_meson

单击最上方铁锤图标,编译程序multiplication_table_meson
单击最上方第二个三角图标,运行程序multiplication_table_meson打印乘法口决表

单击最上方第三个三角图标——选择运行命令——运行命令——自动发现或者multiplication_table_meson
单击最上方铁锤图标旁边的倒三角图标——清理
单击最上方铁锤图标旁边的倒三角图标——重新构建

删除SDK文件的命令
localhost:~ # flatpak uninstall --unused
或者
localhost:~ # flatpak uninstall org.freedesktop.Sdk

\ ID Branch Op
\ 1. org.freedesktop.Sdk 25.08 r
\ 2. org.freedesktop.Sdk.Locale 25.08 r
\ 3. org.freedesktop.Platform.codecs-extra 25.08-extra r

Proceed with these changes to the system installation? [Y/n]: Y 输入大写字母Y再按回车键

http://www.jsqmd.com/news/483978/

相关文章:

  • 安装英文版Linux
  • CPC认证是什么?CPC认证是怎么收费的?
  • 三菱FX3U PLC 与昆仑通泰触摸屏控制松下伺服电机使用例程分享
  • 智阅—基于大模型API的文档智能总结系统
  • 拼多多2026届校招春招开始啦!
  • python微信小程序的学习资料分享系统
  • 满树的遍历--题解
  • 90天蜕变!我的大模型入门项目管理计划,保姆级教程免费送!一个普通人的90天学习路线图
  • 机器学习34:元学习(Meta Learning)
  • c++问题:free (): double free detected in tcache
  • 小程序毕业设计-基于微信小程序的在线学习在线课程系统的设计与实现
  • spring框架的主要几个依赖
  • 8:《死亡笔记》历史必然性:私人执法者在法律崩溃时的永恒规律(从罗马到现代义警)
  • 1949 AI:轻量化智能工具的应用优势与实践价值
  • 电力系统调频控制技术与仿真建模实践
  • 2026 年南宁物业律师口碑榜出炉,哪家强?
  • 用这个办法修复扬声器----------JAMO低音炮喇叭维修小记
  • 计算机毕业设计ssm小型养猪场信息化管理系统 基于SSM框架的小型养猪场智能化管理系统开发 SSM架构下的小型养猪场数字化管理平台设计
  • 冒泡,选择,插入排序再学习
  • iOS 上架 4.3a 被拒【uniapp专讲】​
  • linux——目录及文件操作
  • 经典的openclaw提示词注入
  • 【全网首家】·openclaw开发的GEO优化系统|小龙虾GEO系统|小龙虾专属GEO优化助理
  • vscode, wsl 使用claude code
  • 一套全方位零售数字化经营系统:技术解析与业务赋能
  • 对一些主流模型的结构解析(pt/onnx/openvino/gguf)
  • 三个F数,像空间F数,近轴工作F数以及工作F数
  • 拒绝上下文自残:用数据库硬刚 AI Agent 的健忘症
  • 设备预测性维护服务商选择的关键维度
  • 模型预测控制专题(八)—— 带宽参数影响分析