The new DLL functionality
BlitzMax Forums/BlitzMax Programming/The new DLL functionality
| ||
Anyone tried it? Does it work well? I used SKn3(I think)'s custom makedll for blitz and it would often crash depending on what the function did, but I'm hoping since bmax now has a proper library stub, which initializes bmax components, this is no longer a problem? Also, do I need to create any external files like defs/exports etc to create a lib? Lastly, do I need to decorate the functions I wish to expose anyway? Thanks. |
| ||
I posted this in the 1.22 update thread, copy dllcrt2.o from your MinGW\lib to your BlitzMax\lib folder then save the following to files in the same directory. dlltest.bmx Function AddIntegers(int1,int2) Return int1+int2 End Function dlltest.def EXPORTS AddIntegers=bb_AddIntegers then in the command prompt, cd C:\BlitzMax\bin bmk makelib C:\dlltest.bmx |
| ||
Along this same line, I have a 'freeware' C Math library called MAPM and it included a batch file that can create the whole lib for you as a ".a" library file. How easy/difficult would this be to use with BMax? The MAPM library (http://www.tc.umn.edu/~ringx004/mapm-main.html) allows you to do many many math functions with precision up to HUNDREDS of significant digits. Anyway, MAPM uses strings and pointers to strings to send and get data to and from the library, so my next question is: Once the library is incorporated into Bmax, will Bmax be able to use the MAPM type which is defined in the library or will this have to BMax-i-tized first? Thanks! Russell |