Linking C++ standard library works with GDC... but not DMD. (Linux)

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 16 05:57:15 PDT 2015


On 4/16/15 4:51 AM, TheGag96 wrote:
> Hi, I've got this project that requires me to link into a C++
> backend. It works just fine when using GDC:
>
> gdc *.d [client libraries]
>
> However, this command using DMD does not work:
>
> dmd -L-lstdc++ *.d [client libraries]
>
> I still get errors involving the standard library not being added
> like:
>
> /usr/include/c++/4.8/iostream:74: undefine reference to
> `std::ios_base::Init::Init()'
> (etc.)

Try dmd -v to tell you exactly what command it is running for link. Then 
play around with the link line to see if you can figure out a way to 
link it correctly.

We can work on fixing the situation from there. Maybe there's a way to 
link using dmd, maybe we have to fix dmd so it allows the correct link call.

-Steve


More information about the Digitalmars-d-learn mailing list