Shared Libraries?
BlitzMax Forums/BlitzMax Programming/Shared Libraries?
| ||
Hi, I was wondering if it, at some point in the future, will become possible to compile BlitzMax files to shared libraries, ie. compile to .dll on Windows, .so on Linux and .WhateverItIs on MacOS? |
| ||
We should be so lucky... |
| ||
That would be a very nice feature. Is there any official statement on that topic? |
| ||
this is possible... but at the moment this is only a hacking with command line parameters |
| ||
".WhateverItIs on MacOS" is .dylib :) |
| ||
>> this is possible... but at the moment this is only a hacking with command line parameters Can you tell me how? |
| ||
http://www.blitzbasic.com/Community/posts.php?topic=43904 <-- tells you how to make a DLL in blitz. and here is how to use that dll as a lib. http://www.blitzbasic.com/Community/posts.php?topic=41803#469834 |
| ||
Hi, This is possible...but it's a little more complex than it sounds. The easiest case would be to generate dlls that expose a 'C' interface - this could be done right now with minimal tweaking of BMK. However, you'd need to keep this in mind while developing - ie: your interface functions wouldn't be able to use Max objects - only C compatible constructs. For example, a function that required a string would need to expose a 'Byte ptr' parameter and internally use String.FromCString() to generate a Blitz string. Where it gets tricky is if you want to write Max dlls for Max apps, which I imagine would be the more common case(?). There are many subtle issues here, especially if you want to make it 'seamless' which would be my goal if I attempted it. |
| ||
plugins are a pain in c/c++ so I agree with mark on the amount of issues, and how complex that it would be. |
| ||
In my case i want to include a dll created with BlitzMax into an c++ application. If i understand you correct, this should be possible right now, correct? If so, is there any example, tutorial or whatever avaible ? And what does 'minimal tweaking of bmk' mean? Does it have to be changed and recompiled or does it need a special parameter when called ? |
| ||
Personally I would be much more interested in an easy way of getting Dll's *into* your Bmax project. |
| ||
I think the 'C' interface approach would be sufficient for the moment. |