Re: How to use templates in a separate library?

2022-06-24 Thread frame via Digitalmars-d-learn
On Thursday, 23 June 2022 at 23:50:42 UTC, monkyyy wrote: On Thursday, 23 June 2022 at 08:12:32 UTC, CrazyMan wrote: linking make sure you use the -i flag when compiling But note, that would be the opposite of using a library.

Re: How to use templates in a separate library?

2022-06-23 Thread monkyyy via Digitalmars-d-learn
On Thursday, 23 June 2022 at 08:12:32 UTC, CrazyMan wrote: linking make sure you use the -i flag when compiling

Re: How to use templates in a separate library?

2022-06-23 Thread frame via Digitalmars-d-learn
On Thursday, 23 June 2022 at 08:12:32 UTC, CrazyMan wrote: I have a separate library and some template interface in it ```d interface IFoo(T) { void setValue(const(T) value); } ``` But when using it in the main program, it throws a linking error. I found that you can make a sourceLibrary

How to use templates in a separate library?

2022-06-23 Thread CrazyMan via Digitalmars-d-learn
I have a separate library and some template interface in it ```d interface IFoo(T) { void setValue(const(T) value); } ``` But when using it in the main program, it throws a linking error. I found that you can make a sourceLibrary that copies the code instead of creating a binary. But