- 好问题 0 提建议
2条回答 默认 最新
- dtbam62840 2017-10-09 14:36关注
The short answer is "no": when you "load" a dynamic-linked library, it's not only actually loaded (as in read from the file) but linked into the address space of your running program — by the special means provided by the OS (on Linux-based systems, at least on x86/amd64 platforms that's an external process; on Windows, it's an in-kernel facility, AFAIK). In other words, loading a dynamic-linked library involves quite a lot of complexity happening behind your back.
Another complication, is whether the DLL is "self-contained" in the sense it only contains "pure" functions — which only perform computations on their input data to provide their output data, — or they call out to the operating system to perform activities such as I/O on files. The way operating systems provide ways to do these kinds of activities to the running processes are drastically different between Windows and Linux.
The last complication I can think of is dependency of this library on others. If the library's code is written in C or C++, it quite likely depends on the C library used by the compiler which compiled the library (on Windows, it's typically that
MSVCRxx.DLLthing). (A simple example is calling
printf()or something like this in a library's code.)
All this means that most of a DLL written on Windows for Windows depends both on Windows and the C or C++ standard library associated with the compiler used to build that library.
That's not to mention that Windows DLL uses PE (Portable Executable) format for its modules while GNU/Linux-based systems natively use the ELF format for its shared object files.本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
- ¥15 关于网上一个easyx制作的见缝插针小游戏(c++)
- ¥15 开地址法双散列函数处理碰撞
- ¥15 想问一下这个是什么情况 虚拟机Linux打不开了
- ¥15 联通光猫掉注册了怎么重新注册上去
- ¥15 关于unity开发steamvr程序遇到的问题
- ¥60 求tc downloader的下载方式
- ¥15 华为 快捷方式 手电筒 接口
- ¥15 Qt6.5支不支持Android13开发啊
- ¥20 网络只能跑一半，应该如何设置
- ¥20 Python调用百度开发者平台人脸识别接口