Thread overview
how to lin standard C++ libraries
Jun 27, 2013
Milvakili
Jun 27, 2013
Adam D. Ruppe
Jun 27, 2013
Milvakili
Jun 27, 2013
Adam D. Ruppe
Jun 27, 2013
Milvakili
Jun 27, 2013
Adam D. Ruppe
Jun 27, 2013
Milvakili
Jun 27, 2013
Adam D. Ruppe
Jun 27, 2013
Mike Parker
June 27, 2013
Hi,

I m trying to link c++ and d code, but I keep getting error when I used stanrd library elements such as vectors or iostream.

dmd do not except -lstdc++ option so what is the correct way doing this?

thanks
June 27, 2013
On Thursday, 27 June 2013 at 00:19:11 UTC, Milvakili wrote:
> dmd do not except -lstdc++ option so what is the correct way doing this?


Pass -L-lstdc++ to dmd.

-L means pass the rest of the option to the linker, and -l of course is known to ld.
June 27, 2013
On Thursday, 27 June 2013 at 00:20:29 UTC, Adam D. Ruppe wrote:
> On Thursday, 27 June 2013 at 00:19:11 UTC, Milvakili wrote:
>> dmd do not except -lstdc++ option so what is the correct way doing this?
>
>
> Pass -L-lstdc++ to dmd.
>
> -L means pass the rest of the option to the linker, and -l of course is known to ld.

I have tried this it did not work.  And tells:

Error: unrecognized switch '-lstdc++'
June 27, 2013
On Thursday, 27 June 2013 at 00:24:49 UTC, Milvakili wrote:
> I have tried this it did not work.  And tells:
>
> Error: unrecognized switch '-lstdc++'

Did you do:

-lstdc++

or

-L-lstdc++

?
June 27, 2013
On Thursday, 27 June 2013 at 00:27:22 UTC, Adam D. Ruppe wrote:
> On Thursday, 27 June 2013 at 00:24:49 UTC, Milvakili wrote:
>> I have tried this it did not work.  And tells:
>>
>> Error: unrecognized switch '-lstdc++'
>
> Did you do:
>
> -lstdc++
>
> or
>
> -L-lstdc++
>
> ?

I do both of them in separate tries.  -L-lstdc++ thing gives the error in the previous message.
June 27, 2013
On Thursday, 27 June 2013 at 00:29:57 UTC, Milvakili wrote:
> I do both of them in separate tries.  -L-lstdc++ thing gives the error in the previous message.

Strange, I don't know what is wrong here. I've done this before with -L-l. You're on Linux using gcc for the C++, right?
June 27, 2013
On Thursday, 27 June 2013 at 00:36:32 UTC, Adam D. Ruppe wrote:
> On Thursday, 27 June 2013 at 00:29:57 UTC, Milvakili wrote:
>> I do both of them in separate tries.  -L-lstdc++ thing gives the error in the previous message.
>
> Strange, I don't know what is wrong here. I've done this before with -L-l. You're on Linux using gcc for the C++, right?

Yep
June 27, 2013
Last thing I can think of is double check and make sure there's no -lxxx on your command line at all. Maybe there was a left over one.

But if it isn't that, I don't know... hopefully someone else will be of more help.
June 27, 2013
On Thursday, 27 June 2013 at 00:48:19 UTC, Adam D. Ruppe wrote:
> Last thing I can think of is double check and make sure there's no -lxxx on your command line at all. Maybe there was a left over one.
>
> But if it isn't that, I don't know... hopefully someone else will be of more help.

Trying to link statically with libstdc++? -L-static-libstdc++