How to use templates in a separate library?

CrazyMan superdanik2004 at gmail.com
Thu Jun 23 08:12:32 UTC 2022


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 with it, I also get a linking 
error, and at the same time it is no longer associated with my 
interface, but with a third-party dependency (bindbc.opengl)

What can I do to fix this?


More information about the Digitalmars-d-learn mailing list