Compile a .so

nobody at nowhere.nonet nobody at nowhere.nonet
Sat Apr 28 22:03:26 PDT 2007


Sebastian <sebastian.faltoni at gmail.com> spewed this unto the Network: 
> hi, is possibile to compile .so for linux and for mac, with D? if
> true how i can do that?  thanks

This isn't handled by a compiler, but the linker, ld. First,
you get the D compiler to generate an .o file. The "-c" option
accomplishes this in both the DMD and GDC compilers:

	# Creates foo.o
	gdc -c foo.d

Then, the "ld" command line is as follows:

	ld -shared foo.o -o foo.so

-- 
All your .signature are belong to us.
Take off every 'sig' for great justice.


More information about the Digitalmars-d-learn mailing list