为什么要编译GtkD(D语言的Gtk +绑定)? [英] GtkD (the Gtk+bindings for the D language) why compile it?

查看:255
本文介绍了为什么要编译GtkD(D语言的Gtk +绑定)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近一直在使用带有D编程语言的GtkD来创建本机应用程序.我已经下载了所有必需的文件,并运行了所有文件,因此我现在可以编译并生成示例应用程序.

I've recently been using GtkD with the D programming language to create native applications. I've downloaded all the necessary files and got everything running so i can now compile and produce sample apps.

我的问题是,在某些指南中,它告诉您在使用的平台上编译GtkD,但这有什么意义呢?编译后,最终在Windows上只有一个lib文件(GtkD.lib),在Linux上只有3个lib文件(以* .a结尾).这些文件是做什么用的,如何使用?就像我说的那样,对这些文件不做任何事情似乎一切正常.

My question is that in some of the guides it tells you to compile GtkD on the platform you are using but what is the point? Once compiled you end up with a single lib file on Windows (GtkD.lib) and three lib files on Linux (ending in *.a). What are these files for and how are they used? Like i said everything seems to be working without doing anything with these files.

我猜您可以静态链接这些链接?那是为了什么?为了避免每次都编译GtkD源?实际上,我确实使用pragma('lib', 'GtkD.lib')语句尝试了该操作,但似乎没有任何作用.

I'm guessing you can statically link these? but what's that for? To avoid compiling the GtkD source each time? I did actually try that using the pragma('lib', 'GtkD.lib') statement but it didn't seem to do anything.

任何人都可以对此发表意见或解释为什么需要这些文件吗?

Can anyone shine any light on this or explain why these files are needed?

推荐答案

导入的源文件未编译,仅针对符号名称和函数签名(和模板)进行解析

source files that are imported aren't compiled, they are only parsed for the symbol names and function signatures (and the templates)

创建库是为了避免每次需要重建时都重新编译整个库,然后编译器只能将.di文件用于导入

creating libs is to avoid needing to recompile the entire library each time you need to rebuild and the compiler can then only use the .di files for the imports

这源于古老的编译时代,如今它可用于保持图书馆的封闭源代码

this stems from the olden days where compiling took ages, and now it can be used to keep a library closed source

这篇关于为什么要编译GtkD(D语言的Gtk +绑定)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆