开发者

linux .so windows .dll - using different librarys "on demand"

开发者 https://www.devze.com 2023-04-11 08:52 出处:网络
I have a collection of so files on linux, e.g.: netio.so.tcp and netio.so.tcp. (in fact this architecture is on开发者_JAVA技巧ly needed because of some proprietary network protocols)

I have a collection of so files on linux, e.g.: netio.so.tcp and netio.so.tcp. (in fact this architecture is on开发者_JAVA技巧ly needed because of some proprietary network protocols) They have the exactly same interface for read/write/open/close. So to use tcp or udp i just create a symlink from either one of these libs to netio.so which my application is linked against. Works fine.

The same application has to run on windows too, but here i can't seem to change names of the dlls. Is there some standard way to solve this problem?


Since softlinks on windows differ in some things(only admin can create them) and don't exist on win versions prior to vista, I implemented it using explicit linking. win: LoadLibraryA/GetProcAddress linux: dlopen/dlsym

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号