help with library build

sclytrack at pi.be sclytrack at pi.be
Fri Jun 16 06:05:53 PDT 2006


I'm having some trouble with the library. Everything in one directory.
dxl.d in the library.

dxl.d  (library)
-----

#module dxl;

#int teller(int x)
#{
#       return x+1;
#}

main.d (application)
------

#module main;

#import std.stdio;
#import dxl;

#int main()
#{
#        int boe=teller(2);
#        writefln("Testing Libraries");
#        return 0;
#}

makefile
--------



all: libdxl.so main.o
cc -o main.exe main.o -lphobos -lpthread -lm -ldxl

main.o: main.d
dmd -c main.d


libdxl.so: dxl.d
dmd -c -fPIC dxl.d
cc -shared -o libdxl.so dxl.o

clean:
-rm *.o
-rm *.so
-rm *~
-rm main.exe

run:
/main.exe


Execution of make
-----------------

dmd -c -fPIC dxl.d
cc -shared -o libdxl.so dxl.o
dmd -c main.d
cc -o main.exe main.o -lphobos -lpthread -lm -ldxl
/usr/bin/ld: cannot find -ldxl
collect2: ld returned 1 exit status
make: *** [all] Error 1



directory listing
-----------------
dxl.d  dxl.o  libdxl.so  main.d  main.o  makefile


More Info
---------
I've a library and I've changed some things to it. And it won't build anymore,
but the previous revision still runs fine. However I wanted to discover the
problem so I tried it again in small scale. I'm having a memory blackout or
something, because I can't even get the test version to operate.

Thanks.





More information about the Digitalmars-d-learn mailing list