D Lang Socket Programming Example

Ramon spam at thanks.no
Sun Sep 8 14:20:47 PDT 2013


On Sunday, 8 September 2013 at 10:42:22 UTC, Savsak wrote:
> ...
> In the example you give, but I receive this error during 
> compilation.
>
> savsak:~ savsak$ dmd /Users/savsak/Desktop/test.d
> ld: library not found for -lphobos2
> collect2: ld returned 1 exit status
> --- errorlevel 1

To help dicebot and others to help you it would be useful to copy 
the output of the following two commands:

> cat /etc/dmd.conf

> find /usr -name 'libphobos2*'

(Please note the *single* ticks (rather than ") to not have your 
shell resolve it. Also note that probably /usr/lib would be more 
efficient as search path but using /usr can also catch exotic 
cases like /usr/share).

If your installation is OK you will find the paths told by the 
find command to match those in /etc/dmd.conf.

Here is an example of a working installation:

$ find /usr -name 'libphobos2*'
/usr/lib/x86_64-linux-gnu/libphobos2.so
/usr/lib/x86_64-linux-gnu/libphobos2.a
/usr/lib/i386-linux-gnu/libphobos2.so
/usr/lib/i386-linux-gnu/libphobos2.a
/usr/lib/i386-linux-gnu/libphobos2.so.0.2
---------------

$ cat /etc/dmd.conf
// ... some comment lines ..

[Environment]

DFLAGS=-I/usr/include/dmd/phobos 
-I/usr/include/dmd/druntime/import -L-L/usr/lib/i386-linux-gnu 
-L-L/usr/lib/x86_64-linux-gnu -L--no-warn-search-mismatch 
-L--export-dynamic
----------------

HtH -R


More information about the Digitalmars-d mailing list