英文:
Why Vala Compiler Throws Errors When Using Question Mark (?) Operator?
问题
我尝试按照说明构建 G4Music(https://gitlab.gnome.org/neithern/g4music),但我遇到了许多语法错误。
如您所见,GTK-4.0 被标记为未找到。但是,我已安装了 GTK-4.4 开发包。
我正在使用 RHEL 9 作为发行版,并且已安装所有所需的包:
- gtk4.x86_64
- gtk4-devel.x86_64
- libvala.x86_64
- libvala-devel.x86_64
- vala.x86_64
- gstreamer1.x86_64
- gstreamer1-devel.x86_64
- libadwaita-1
我了解到 ? 运算符(问号)用于控制空值,而且有很多代码使用了这个运算符。
我对 Vala 语言没有经验。
我是否缺少某些库?为什么 Vala 编译器会因为这个运算符而报错?
提前感谢。
英文:
I tried to build G4Music (https://gitlab.gnome.org/neithern/g4music) following its instructions but I got many syntax errors.
As you can see GTK-4.0 is marked as not found. However I have installed GTK-4.4 dev packages.
I'm using RHEL 9 as distro and I have all the packages required:
- gtk4.x86_64
- gtk4-devel.x86_64
- libvala.x86_64
- libvala-devel.x86_64
- vala.x86_64
- gstreamer1.x86_64
- gstreamer1-devel.x86_64
- libadwaita-1
I read that ? operator (question mark) is used to control null values and there's a lot of code using this operator.
I have no experience with Vala language.
Do I missing some libraries? Why Vala compiler throw errors for this operator?
Thanks in advance
答案1
得分: 0
看起来空条件运算符是在Vala 0.53.1中引入的,该版本于2021年8月20日发布。这是一个开发版本,所以您需要安装Vala 0.54+来进行编译。
要了解有关空条件运算符的更多信息,请阅读合并请求和问题。理想情况下,g4music的构建系统应检查所需的Vala编译器的最低版本。
英文:
It looks like the null conditional operator was introduced in Vala 0.53.1, which was tagged 20 August 2021. That's a development release, so you want Vala 0.54+ installed to compile this.
To learn more about the null conditional operator read the merge request and issue. Ideally the build system for g4music would check for the minimum version of the Vala compiler needed.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论