Linking order on Linux matters?

Antoche N at A.c
Mon Nov 25 12:29:17 PST 2013


On Monday, 25 November 2013 at 18:19:57 UTC, Jeremy DeHaan wrote:
> Hey all,
>
> New to Linux, so I wanted to double check something. I have a C 
> shared library and a D static library. The D static library 
> uses functions from the C library. On Windows, it didn't matter 
> what order I linked the .libs in and it always compiled fine. 
> On Linux, however, I have to link the static library first and 
> then the shared library or else I get undefined symbols for 
> each extern(C) function I declare in my D code. Is this normal 
> for Linux or is it a compiler bug?
>
> Thanks!

Order matters, no matter the language. See
http://stackoverflow.com/a/409470/1924406


More information about the Digitalmars-d-learn mailing list