Thread overview
Re: FreeBSD linking problem
Aug 11, 2011
s4mmael
Aug 12, 2011
Jacob Carlborg
Aug 12, 2011
s4mmael
Aug 12, 2011
Jacob Carlborg
August 11, 2011
Dr. Adam Ruppe and Jacob Carlborg,

Thank you very much for your help!



An error now is as follows:
# dmd2 -run qqq.d
/usr/bin/ld: cannot find -lphobos2
--- errorlevel 1

# cat /usr/local/etc/dmd2.conf

[Environment]

DFLAGS=-I/usr/local/include/d/phobos2 -I/usr/local/include/d/druntime/import -L-L/usr/local/lib32 -L-L%@P%/../lib64 -L--export-dynamic -L-lrt
August 12, 2011
On 2011-08-11 16:10, s4mmael wrote:
> Dr. Adam Ruppe and Jacob Carlborg,
>
> Thank you very much for your help!
>
>
>
> An error now is as follows:
> # dmd2 -run qqq.d
> /usr/bin/ld: cannot find -lphobos2
> --- errorlevel 1
>
> # cat /usr/local/etc/dmd2.conf
>
> [Environment]
>
> DFLAGS=-I/usr/local/include/d/phobos2 -I/usr/local/include/d/druntime/import
> -L-L/usr/local/lib32 -L-L%@P%/../lib64 -L--export-dynamic -L-lrt

Seems it cannot find libphobos2.a in any of the specified search paths. The specified search paths are:

/usr/local/lib32
%@P%/../lib64

Where %@P% is relative to the binary. Also all the search paths for all the regular C libraries: /usr/lib, /usr/local/lib and so on, don't know the exact search paths on FreeBSD.

-- 
/Jacob Carlborg
August 12, 2011
I added /usr/local/lib to my config:
# cat /usr/local/etc/dmd2.conf

[Environment]

DFLAGS=-I/usr/local/include/d/phobos2 -I/usr/local/include/d/druntime/import -L-L/usr/local/lib32  -L-L/usr/local/lib -L-L%@P%/../lib64 -L--export-dynamic -L-lrt

Now it's OK.
Your help was very useful, thank you!
August 12, 2011
On 2011-08-12 09:16, s4mmael wrote:
> I added /usr/local/lib to my config:
> # cat /usr/local/etc/dmd2.conf
>
> [Environment]
>
> DFLAGS=-I/usr/local/include/d/phobos2 -I/usr/local/include/d/druntime/import
> -L-L/usr/local/lib32  -L-L/usr/local/lib -L-L%@P%/../lib64 -L--export-dynamic -L-lrt
>
> Now it's OK.
> Your help was very useful, thank you!

No problem.

-- 
/Jacob Carlborg