dynamic library building and loading

Jacob Carlborg doob at me.com
Mon Oct 1 10:18:46 PDT 2012


On 2012-10-01 17:06, Johannes Pfau wrote:

> the problem is that we don't want the C main function in a shared
> libgdruntime.so, because you might want to use libgdruntime.so in a
> C/C++ app which has it's own main function.
>
> So we currently don't link in dmain2.o into the shared library and it
> must be included manually when linking an application.
> (But dmain2 also contains some stuff that really should be in
> libdruntime.so, so this source file should probably be split up at some
> time.)

I'm not sure if I follow this correctly or not, but why is this needed 
to be handled manually? If you pass "-shared" to the compiler just skip 
linking dmain2.o, otherwise link with it. Would that work?

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list