dmd's linking order

Jacob Carlborg doob at me.com
Wed Apr 11 01:25:37 PDT 2012


On 2012-04-11 03:46, Jonathan M Davis wrote:
> This stackoverflow question raises an interesting issue with linking order and
> dmd:
>
> http://stackoverflow.com/questions/10095150/std-net-curl-linker-errors-in-linux
>
> I don't know if it's this way on Linux machines in general, but the OP had to
> link his program manually to be able to use std.curl. dmd appears to put the -
> L argument before any of its own linker arguments, and in this case, the
> linking argument for curl needs to go on the end.
>
> So, my question is whether dmd should be changed to put any -L arguments
> passed to it after the arguments that it passes to the linker itself. I'm far
> from an expert on this and am quite surprised that the order of arguments to
> the linker matters, but since it does, it seems to me that we should find the
> optimal order for dmd to use if we can, since it's not terribly user friendly
> to force people to call gcc or ld directly rather than using dmd to link just
> because they want to pass an argument to the linker. That's what the -L flag is
> supposed to be for.
>
> - Jonathan M Davis

Could it happen that the linker arguments need to be placed first 
sometimes ?

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list