SDL.dll 中有什么?
我是 SDL 的新手,我只是好奇为什么 sdl 使用静态和动态库?我的意思是,sdl.dll 中有哪些函数,为什么它是动态链接而不是静态链接?谢谢。
I am new to SDL, and I am just curious why does sdl use static and dynamic libraries? I mean, what functions are in sdl.dll, and why is it linked dynamically instead of statically? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SDL.dll
包含您在 SDL 中使用的所有函数的实现,例如SDL_Init()
和SDL_SetVideoMode()
。它是动态链接的,允许用较新的版本直接替换库,而不会破坏与现有应用程序的兼容性 - SDL接口几乎不会像实现那样频繁地更改。动态库提供了接口和实现之间的解耦,但代价是动态加载它们所需的一切:搜索文件、加载文件、抱怨文件不可用等等。使用动态库的应用程序更加模块化,并且可执行文件往往会很小。可以静态链接 SDL,在这种情况下,可执行文件的大小将包括 SDL 库的(适度)大小,并且升级到较新版本的 SDL 将需要重新编译您的应用程序。
SDL.dll
contains implementations of all of the functions that you use from SDL, such asSDL_Init()
andSDL_SetVideoMode()
. It's linked dynamically to allow drop-in replacement of the library with a newer version, without breaking compatibility with existing applications—the SDL interface does not change nearly as often as the implementation. Dynamic libraries provide decoupling between interface and implementation, at the cost of whatever it takes to load them dynamically: searching for a file, loading it, complaining if it's not available, and so on.An application is more modular using dynamic libraries, and the executable will tend to remain small. It is possible to link statically against SDL, under which circumstances the size of your executable will include the (modest) size of the SDL library, and upgrading to a newer version of SDL will require recompiling your application.