为什么游戏引擎preFER静态库对动态链接库 [英] why do game engines prefer static libraries over dynamic link libraries

查看:176
本文介绍了为什么游戏引擎preFER静态库对动态链接库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在读几本书的游戏。他们总是preFER创建引擎对动态链接静态库。我是新的C ++,所以我不认识的高度,当涉及到静态库和动态链接库。我所知道的是静态库增加你的程序,在这里,你在程序中需要这些DLL链接库被加载的尺寸。

I've been reading a few gaming books. And they always prefer to create the engine as a static library over dynamic link. I am new to c++ so I am not highly knowledge when it comes to static libraries and dynamic link libraries. All I know is static libraries increase the size of your program, where DLL link libraries are loaded as you need them within your program.

我玩过的游​​戏在那里几乎似乎他们用DLL在音响,灯光加载,什么不是所有的个别。作为水平加载了。因为你不一定需要,当你在游戏中的菜单。

I've played games where it almost seemed they used DLL's to load in sound, lighting, and what not all individually. as the level was loading up. cause you don't necessarily need that when your at the game menu.

推荐答案

动态链接库需要独立定位;这可以在某些处理器架构会导致性能的低效率。

Dynamic link libraries need to be position independent; this can cause performance inefficiencies on some processor architectures.

静态库可以进行优化,通过剥离死code。这可以提高缓存性能。

Static libraries can be optimized when included in your program, e.g., by stripping dead code. This can improve cache performance.

这篇关于为什么游戏引擎preFER静态库对动态链接库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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