Shared Libraries?

BlitzMax Forums/BlitzMax Programming/Shared Libraries?

fredborg(Posted 2005) [#1]
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?


Chris C(Posted 2005) [#2]
We should be so lucky...


Mirko(Posted 2005) [#3]
That would be a very nice feature.
Is there any official statement on that topic?


MrCredo(Posted 2005) [#4]
this is possible... but at the moment this is only a hacking with command line parameters


JaviCervera(Posted 2005) [#5]
".WhateverItIs on MacOS" is .dylib :)


Mirko(Posted 2005) [#6]
>> this is possible... but at the moment this is only a hacking with command line parameters

Can you tell me how?


Drago(Posted 2005) [#7]
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


marksibly(Posted 2005) [#8]
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.


Drago(Posted 2005) [#9]
plugins are a pain in c/c++ so I agree with mark on the amount of issues, and how complex that it would be.


Mirko(Posted 2005) [#10]
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 ?


GW(Posted 2005) [#11]
Personally I would be much more interested in an easy way of getting Dll's *into* your Bmax project.


Knotz(Posted 2005) [#12]
I think the 'C' interface approach would be sufficient for the moment.