Welcome, Guest. Please login or register.

Author Topic: C++ shared libs?  (Read 4398 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline psxphill

Re: C++ shared libs?
« on: December 05, 2012, 08:20:35 PM »
Quote from: SamuraiCrow;717627
Nope. You'd be the first.

According to this:
 
http://www.amigareport.com/ar131/p1-7.html
 
It's possible with SAS/C 6.5
 
"Better Support for Shared Libraries and Devices

You can build your shared libraries in C++!  You can use C++ member functions
as library entry points, including constructor and destructor functions.
Encapsulate your entire C++ class as an AmigaDOS shared library."
 

Offline psxphill

Re: C++ shared libs?
« Reply #1 on: December 06, 2012, 02:59:20 PM »
Quote from: andst;717776
The SAS/C example is evidence that at least *some* incarnation of a C++ shared library is possible on Amiga. SAS/C won't be able to compile wxWidgets, but I'm perfectly open to modifying gcc/g++ if needed. I'm also thinking that C++ shared libraries works with DLL's on Windows. Without knowing in detail exactly how it's done for DLL's, in my experience regular DLL's have mostly similar functionality to Amiga resident libraries. Or is there any critical feature of DLL's that is missing from Amiga resident libraries?

I'm not sure that you can derive from a C++ class in Windows DLL's either, that is what COM is for. COM standardises on what the vtable's look like and how to cast from one object type to another. I would guess that the AOS4 libraries are similar to COM.
 
There is no reason at all why it can't be done on AOS3, but you'll need to add compiler support & then you will be limited to that one compiler (but I guess you have that problem on AOS4 too). I don't know how SAS/C does it and whether it's worth copying their method or not.