Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Using dll in BlitzMax

Recommended Posts

Hi everyone!

I'm making some library now with C++. And I want to make it as dll. Is it possible to use it in BlitzMax.? I was trying to google this question, but all links Iv found lead me to BlitzMax forum. And it

doesn't work now.


Lets say I have some class with methods:

class myClass
public void myClas(string var1, Tvec3 var2){}
public void ~myClass(){}
public void someMethod(TVec3 var1, TEntity entity);


How should I wrap this class in bmax.


Thanks in advance.

Link to post
Share on other sites

In the BlitzMax help under "Help/Language/Advanced topics/Interfacing with C" there is an example how to import a C++ class into BlitzMax.


Using this example you could expand it so that the cpp file loads the actual DLL where the actual C++ code is, so that the imported cpp file acts only as a interface header to the dll.


However, you could as well just write the whole C++ code in the cpp file which is imported by BlitzMax, since it would be faster code than if you compiled the DLL with Visual Studio, because BlitzMax uses MinGW C++.


Or if you want it even faster, you could write the DLL in MinGW Fortran, then load it with C++, and then import it in BlitzMax, and it would still be OOP through the whole chain :huh:

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...