Generally a library will be released in a single language (for example C). If the library tuns out to be useful then many language wrappers for that library will be written. How exactly do they do it?
Kindly someone throw little light on this topic. If it is too language dependent pick language of your c开发者_StackOverflowhoice and explain it.
There are a few options that come to mind:
- Port the original C library to the language/platform of your choice
- Compile the C library into something (like a DLL) that can be invoked from other components
- Put the library on the web, expose an API over HTTP and wrap that on the client
If I wanted to wrap a C library with a managed (.NET) layer, I'd compile the library into a DLL, exposing the APIs I wanted. Then, I'd use P/Invoke to call those APIs from my C# code.
精彩评论