linux .so windows .dll - using different librarys "on demand"
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
精彩评论