Jump to page: 1 2
Thread overview
How to install dmd2 in centos 5.3 x64
Dec 03, 2013
Puming
Dec 03, 2013
lomereiter
Dec 03, 2013
Puming
Dec 03, 2013
Jordi Sayol
Dec 03, 2013
Puming
Dec 03, 2013
Jordi Sayol
Dec 03, 2013
Dejan Lekic
Dec 04, 2013
Puming
Feb 25, 2014
thr4wa
Feb 25, 2014
FreeSlave
Feb 26, 2014
thr4wa
Oct 10, 2014
Rafael
Oct 10, 2014
Rafael
December 03, 2013
Hi:

I followed the steps in http://dlang.org/dmd-linux.html, but when I build a simple hello world program with:

rdmd hello.d

I get the following error:

rdmd hello.d
/usr/bin/ld: cannot find -l:libphobos2.a

I have copied dmd2/linux/lib64/libphobos2.a to /usr/lib64, but ld still can't find it.

Now I really wish all our servers are using ubuntu server..

Could anybody shed some light on where the problem is? I don't have much experience in linux except using apt-get in ubuntu.

Thanks.

Puming.
December 03, 2013
Did you install binaries or build the compiler from source?

December 03, 2013
El 03/12/13 11:43, Puming ha escrit:
> Hi:
> 
> I followed the steps in http://dlang.org/dmd-linux.html, but when I build a simple hello world program with:
> 
> rdmd hello.d
> 
> I get the following error:
> 
> rdmd hello.d
> /usr/bin/ld: cannot find -l:libphobos2.a
> 
> I have copied dmd2/linux/lib64/libphobos2.a to /usr/lib64, but ld still can't find it.
> 

$ rdmd -L-L/usr/lib64 a.d

You can permanently add this to dmd command-line by creating "dmd.conf" file: <http://dlang.org/dmd-linux.html#dmd_conf>

> Now I really wish all our servers are using ubuntu server..
> 
> Could anybody shed some light on where the problem is? I don't have much experience in linux except using apt-get in ubuntu.

On Debian based systems, like Ubuntu, you can use "d-apt" repository: <http://d-apt.sourceforge.net/>

> 
> Thanks.
> 
> Puming.
> 

-- 
Jordi Sayol
December 03, 2013
On Tuesday, 3 December 2013 at 11:10:13 UTC, lomereiter wrote:
> Did you install binaries or build the compiler from source?

I used the dmd.2.064.2.zip, because when I install the rpm binary, it says there are dependency issues.

December 03, 2013
On Tuesday, 3 December 2013 at 11:17:27 UTC, Jordi Sayol wrote:
> El 03/12/13 11:43, Puming ha escrit:
>> Hi:
>> 
>> I followed the steps in http://dlang.org/dmd-linux.html, but when I build a simple hello world program with:
>> 
>> rdmd hello.d
>> 
>> I get the following error:
>> 
>> rdmd hello.d
>> /usr/bin/ld: cannot find -l:libphobos2.a
>> 
>> I have copied dmd2/linux/lib64/libphobos2.a to /usr/lib64, but ld still can't find it.
>> 
>
> $ rdmd -L-L/usr/lib64 a.d
>

still get the same error.

> You can permanently add this to dmd command-line by creating

I was using the default dmd.conf in the .zip package


> "dmd.conf" file: <http://dlang.org/dmd-linux.html#dmd_conf>
>
>> Now I really wish all our servers are using ubuntu server..
>> 
>> Could anybody shed some light on where the problem is? I don't have much experience in linux except using apt-get in ubuntu.
>
> On Debian based systems, like Ubuntu, you can use "d-apt" repository: <http://d-apt.sourceforge.net/>

Yes, I was using that at home.

>
>> 
>> Thanks.
>> 
>> Puming.

December 03, 2013
El 03/12/13 14:10, Puming ha escrit:
> On Tuesday, 3 December 2013 at 11:17:27 UTC, Jordi Sayol wrote:
>> El 03/12/13 11:43, Puming ha escrit:
>>> Hi:
>>>
>>> I followed the steps in http://dlang.org/dmd-linux.html, but when I build a simple hello world program with:
>>>
>>> rdmd hello.d
>>>
>>> I get the following error:
>>>
>>> rdmd hello.d
>>> /usr/bin/ld: cannot find -l:libphobos2.a
>>>
>>> I have copied dmd2/linux/lib64/libphobos2.a to /usr/lib64, but ld still can't find it.
>>>
>>
>> $ rdmd -L-L/usr/lib64 a.d
>>
> 
> still get the same error.

Is "libphobos2.a" the same arch than the program you're building?

> 
>> You can permanently add this to dmd command-line by creating
> 
> I was using the default dmd.conf in the .zip package
> 
> 
>> "dmd.conf" file: <http://dlang.org/dmd-linux.html#dmd_conf>
>>
>>> Now I really wish all our servers are using ubuntu server..
>>>
>>> Could anybody shed some light on where the problem is? I don't have much experience in linux except using apt-get in ubuntu.
>>
>> On Debian based systems, like Ubuntu, you can use "d-apt" repository: <http://d-apt.sourceforge.net/>
> 
> Yes, I was using that at home.
> 
>>
>>>
>>> Thanks.
>>>
>>> Puming.
> 
> 

-- 
Jordi Sayol
December 03, 2013
On Tuesday, 3 December 2013 at 10:43:06 UTC, Puming wrote:
> Hi:
>
> I followed the steps in http://dlang.org/dmd-linux.html, but when I build a simple hello world program with:
>
> rdmd hello.d
>
> I get the following error:
>
> rdmd hello.d
> /usr/bin/ld: cannot find -l:libphobos2.a
>
> I have copied dmd2/linux/lib64/libphobos2.a to /usr/lib64, but ld still can't find it.
>
> Now I really wish all our servers are using ubuntu server..
>
> Could anybody shed some light on where the problem is? I don't have much experience in linux except using apt-get in ubuntu.
>
> Thanks.
>
> Puming.

What architecture that CentOS box is, and give us your /etc/dmd.conf please.
December 04, 2013
On Tuesday, 3 December 2013 at 17:47:47 UTC, Dejan Lekic wrote:
> On Tuesday, 3 December 2013 at 10:43:06 UTC, Puming wrote:
>> Hi:
>>
>> I followed the steps in http://dlang.org/dmd-linux.html, but when I build a simple hello world program with:
>>
>> rdmd hello.d
>>
>> I get the following error:
>>
>> rdmd hello.d
>> /usr/bin/ld: cannot find -l:libphobos2.a
>>
>> I have copied dmd2/linux/lib64/libphobos2.a to /usr/lib64, but ld still can't find it.
>>
>> Now I really wish all our servers are using ubuntu server..
>>
>> Could anybody shed some light on where the problem is? I don't have much experience in linux except using apt-get in ubuntu.
>>
>> Thanks.
>>
>> Puming.
>
> What architecture that CentOS box is, and give us your /etc/dmd.conf please.

model name	: Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz

Linux 2.6.18-308.el5 #1 SMP EST 2012 x86_64 x86_64 x86_64 GNU/Linux

I'm using the the dmd.conf in dmd.2.064.2.zip



[Environment]

#DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib64 -L-L%@P%/../lib32 -L--no-warn-search-mismatch -L--export-dynamic
DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib64 -L-L%@P%/../lib32 -L--export-dynamic

I commented out the -L--no-warn-search-mismatch because when building there's an error:

/usr/bin/ld: unrecognized option '--no-warn-search-mismatch'


February 25, 2014
same problem:

$DMDLOC/dmd2/linux/bin64/dmd hello.d
/usr/bin/ld: cannot find -l:libphobos2.a
collect2: ld returned 1 exit status
--- errorlevel 1


$ cat $DMDLOC/dmd2/linux/bin64/dmd.conf

[Environment]

DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib64 -L-L%@P%/../lib32 -L--export-dynamic

extracted src from dmd.2.064.2.zip and built phobos and dmd from there. fails even on setting LOAD_LIBRARY paths

$ export LD_LOAD_LIBRARY=$DMDLOC/dmd2/linux/lib64
$ export LOAD_LIBRARY=$DMDLOC/dmd2/linux/lib64
$ $DMDLOC/dmd2/linux/bin64/dmd hello.d
/usr/bin/ld: cannot find -l:libphobos2.a
collect2: ld returned 1 exit status
--- errorlevel 1

$ ls $DMDLOC/dmd2/linux/lib64
hello.o  libphobos2.a  libphobos2.so  libphobos2.so.0.	libphobos2.so.0..0  libphobos2.so.0..o

$ lsb_release -a
LSB Version:	:core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID:	CentOS
Description:	CentOS release 5.10 (Final)
Release:	5.10
Codename:	Final

am i doing something silly here?



On Wednesday, 4 December 2013 at 01:27:24 UTC, Puming wrote:
> On Tuesday, 3 December 2013 at 17:47:47 UTC, Dejan Lekic wrote:
>> On Tuesday, 3 December 2013 at 10:43:06 UTC, Puming wrote:
>>> Hi:
>>>
>>> I followed the steps in http://dlang.org/dmd-linux.html, but when I build a simple hello world program with:
>>>
>>> rdmd hello.d
>>>
>>> I get the following error:
>>>
>>> rdmd hello.d
>>> /usr/bin/ld: cannot find -l:libphobos2.a
>>>
>>> I have copied dmd2/linux/lib64/libphobos2.a to /usr/lib64, but ld still can't find it.
>>>
>>> Now I really wish all our servers are using ubuntu server..
>>>
>>> Could anybody shed some light on where the problem is? I don't have much experience in linux except using apt-get in ubuntu.
>>>
>>> Thanks.
>>>
>>> Puming.
>>
>> What architecture that CentOS box is, and give us your /etc/dmd.conf please.
>
> model name	: Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz
>
> Linux 2.6.18-308.el5 #1 SMP EST 2012 x86_64 x86_64 x86_64 GNU/Linux
>
> I'm using the the dmd.conf in dmd.2.064.2.zip
>
>
>
> [Environment]
>
> #DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib64 -L-L%@P%/../lib32 -L--no-warn-search-mismatch -L--export-dynamic
> DFLAGS=-I%@P%/../../src/phobos -I%@P%/../../src/druntime/import -L-L%@P%/../lib64 -L-L%@P%/../lib32 -L--export-dynamic
>
> I commented out the -L--no-warn-search-mismatch because when building there's an error:
>
> /usr/bin/ld: unrecognized option '--no-warn-search-mismatch'

February 25, 2014
It's not dmd problem, it's up to ld linker and the issue is same for other compiled languages including C and C++. You should specify LD_LIBRARY_PATH variable in your system before executing any compiled D application. You can add export of this environment variable to your $HOME/.profile or $HOME/.bashrc depending on your system or edit paths in /etc/ld.so.conf.d or /etc/ld.so.conf. The other way is to copy libphobos to path where ld can find it by default, for example, /usr/local/lib.
« First   ‹ Prev
1 2