undefined symbol: rt_finalize

Tolga Cakiroglu tcak at pcak.com
Wed Feb 26 22:25:42 PST 2014


I am trying to compile a shared library on Linux and use it.

lib.d
---------------------------
import core.runtime;

class A{}

extern(C) void foo(){
	Object obj = new Object();

	A objA = new A();

	char[] c = new char[ 1024 ];

	destroy( objA );
	destroy( c );
}


makefile:
--------------------------
lib:
	dmd -c lib.d -fPIC -debug -gc -g -w -wi
	gcc --shared lib.o -o lib.so


After getting the `foo` symbol in the app by using dlsym, I call 
it, the following is output on the shell:

library is loaded now
Running functions...
./app: symbol lookup error: ./lib.so: undefined symbol: 
rt_finalize


Where exactly is that function linked into an application? and 
why is it not linked into the library? Does it require an extra 
flag?


More information about the Digitalmars-d-learn mailing list