Creating dlls for various OS?
BlitzMax Forums/BlitzMax Beginners Area/Creating dlls for various OS?
| ||
Hello everybody, how can I use a dll in BlitzMax under Windows (LoadLibraryA) and Linux as well? I guess Mac doesn't work and I have to rewrite that stuff. Example... The dll I want to write communicates over the RS232 to the hardware and returns the result to BM. Can I use the same library on both systems? For Mac I have to find another way. Greetings Simon |
| ||
If you can compile the library under both yes. Windows uses .dlls, and *nix uses .so Changing the extension won't do it. You'll need the library compiled under each. |
| ||
You can get USB->Serial converters which work well on the Mac. If you write your code in such a way that allows you to compile it for the three platforms, it should work fine. I've got a working cross-platform serial module (tested on Mac, Linux and Win32) using the same high-level API, so it's perfectly doable. The tricky bit is accessing the various system APIs/ports, but once you have the line opened, it's all pretty much the same everywhere. Good luck! :-) |
| ||
I have a cross-platform library written in BlitzMax to load a dll (.so on Linux, .dylib on OS X) and get the function pointers. I can release it as public domain if anyone is interested (would be cool to see it added to BlitzMax "pub" repository, since I think is a useful addition). |
| ||
@Jedive: Yes, please :) |
| ||
I'm interested! |