Segmentation fault while creating a class object by dlsym-ed function

Jacob Carlborg doob at me.com
Tue Jul 17 23:40:35 PDT 2012


On 2012-07-18 06:51, Konstantin J. Chernov wrote:
> Hello. When I'm trying to create a class object by using a dlsym-ed
> function, I'm getting a segmentation fault after execution of program.
>
> However, if I'm deleting that object before 'return 0' in main (by using
> 'delete b'), everything is going fine.
>
> I'm just started to learn D after using C++ for more than 5 years, so
> some things look really strange for me (especially that 'new
> className()' doesn't return a pointer).

Classes are always references.

> What am I doing wrong here? Is there any way to do what I'm trying to do
> right way?

Dynamic libraries aren't properly supported by the runtime.

-- 
/Jacob Carlborg




More information about the Digitalmars-d-learn mailing list