Thread overview
DMD and LD
Nov 06, 2004
Lethalman
Nov 06, 2004
Lars Ivar Igesund
Nov 07, 2004
Lethalman
Nov 07, 2004
Lars Ivar Igesund
Nov 07, 2004
Ben Hinkle
November 06, 2004
Hi, i made a simple object of the sample 'hello' by typing:

$ dmd -c hello.d

So i got hello.o
Now i want to link it by using ld and it returns an error:

$ ld -lc -lm -lpthread -lphobos hello.o -o hello
ld: warning: cannot find entry symbol _start; defaulting to 00000000080481a0
hello.o(.gnu.linkonce.t_assert_5hello+0x11): In function `_assert_5hello':
: undefined reference to `_d_assert'
hello.o(.gnu.linkonce.t_array_5hello+0x11): In function `_array_5hello':
: undefined reference to `_d_array_bounds

It works fine down here:

$ gcc -lm -lpthread -lphobos hello.o -o hello

But i need to compile it with ld, any suggestions?


November 06, 2004
Lethalman wrote:

> Hi, i made a simple object of the sample 'hello' by typing:
> 
> $ dmd -c hello.d
> 
> So i got hello.o
> Now i want to link it by using ld and it returns an error:
> 
> $ ld -lc -lm -lpthread -lphobos hello.o -o hello
> ld: warning: cannot find entry symbol _start; defaulting to 00000000080481a0
> hello.o(.gnu.linkonce.t_assert_5hello+0x11): In function `_assert_5hello':
> : undefined reference to `_d_assert'
> hello.o(.gnu.linkonce.t_array_5hello+0x11): In function `_array_5hello':
> : undefined reference to `_d_array_bounds
> 
> It works fine down here:
> 
> $ gcc -lm -lpthread -lphobos hello.o -o hello
> 
> But i need to compile it with ld, any suggestions?
> 
> 

Have you tried compiling with gdc?

Lars Ivar Igesund
November 07, 2004
In article <cmiv5l$246s$1@digitaldaemon.com>, Lars Ivar Igesund says...
>
>Lethalman wrote:
>
>> Hi, i made a simple object of the sample 'hello' by typing:
>> 
>> $ dmd -c hello.d
>> 
>> So i got hello.o
>> Now i want to link it by using ld and it returns an error:
>> 
>> $ ld -lc -lm -lpthread -lphobos hello.o -o hello
>> ld: warning: cannot find entry symbol _start; defaulting to 00000000080481a0
>> hello.o(.gnu.linkonce.t_assert_5hello+0x11): In function `_assert_5hello':
>> : undefined reference to `_d_assert'
>> hello.o(.gnu.linkonce.t_array_5hello+0x11): In function `_array_5hello':
>> : undefined reference to `_d_array_bounds
>> 
>> It works fine down here:
>> 
>> $ gcc -lm -lpthread -lphobos hello.o -o hello
>> 
>> But i need to compile it with ld, any suggestions?
>> 
>> 
>
>Have you tried compiling with gdc?
>
>Lars Ivar Igesund
I can't do it right now! I've a poor 56k and a really poor computer, i need about a day to download GCC and compile it with GDC...

Do you know it works fine with GDC?


November 07, 2004
Lethalman wrote:
> In article <cmiv5l$246s$1@digitaldaemon.com>, Lars Ivar Igesund says...
> 
>>Lethalman wrote:
>>
>>
>>>Hi, i made a simple object of the sample 'hello' by typing:
>>>
>>>$ dmd -c hello.d
>>>
>>>So i got hello.o
>>>Now i want to link it by using ld and it returns an error:
>>>
>>>$ ld -lc -lm -lpthread -lphobos hello.o -o hello
>>>ld: warning: cannot find entry symbol _start; defaulting to 00000000080481a0
>>>hello.o(.gnu.linkonce.t_assert_5hello+0x11): In function `_assert_5hello':
>>>: undefined reference to `_d_assert'
>>>hello.o(.gnu.linkonce.t_array_5hello+0x11): In function `_array_5hello':
>>>: undefined reference to `_d_array_bounds
>>>
>>>It works fine down here:
>>>
>>>$ gcc -lm -lpthread -lphobos hello.o -o hello
>>>
>>>But i need to compile it with ld, any suggestions?
>>>
>>>
>>
>>Have you tried compiling with gdc?
>>
>>Lars Ivar Igesund
> 
> I can't do it right now! I've a poor 56k and a really poor computer, i need
> about a day to download GCC and compile it with GDC...
> 
> Do you know it works fine with GDC?
> 
> 

No idea :) Check out the D.gnu NG.

Lars Ivar Igesund
November 07, 2004
Lethalman wrote:

> Hi, i made a simple object of the sample 'hello' by typing:
> 
> $ dmd -c hello.d
> 
> So i got hello.o
> Now i want to link it by using ld and it returns an error:
> 
> $ ld -lc -lm -lpthread -lphobos hello.o -o hello
> ld: warning: cannot find entry symbol _start; defaulting to
> 00000000080481a0 hello.o(.gnu.linkonce.t_assert_5hello+0x11): In function
> `_assert_5hello':
> : undefined reference to `_d_assert'
> hello.o(.gnu.linkonce.t_array_5hello+0x11): In function `_array_5hello':
> : undefined reference to `_d_array_bounds
> 
> It works fine down here:
> 
> $ gcc -lm -lpthread -lphobos hello.o -o hello
> 
> But i need to compile it with ld, any suggestions?

looks like it couldn't find phobos since that is where _d_assert and _d_assert_bounds are located. I'm also not sure how to tell it what main to use.