Making a D library for a C executable

Mike Parker aldacron at gmail.com
Thu Apr 27 21:05:00 UTC 2023


On Thursday, 27 April 2023 at 20:32:24 UTC, Jan Allersma wrote:

> ```
> Apparently foo isn't found from the CPP source file. Anyone 
> some ideas on how to solve this? :)

That's a compilation error, not a linker problem. You need to 
tell the compiler about the function with a prototype:

```C++
#include <iostream>

int foo();

int main() {
   std::cout << "deede" << foo() << std::endl;
}
```




More information about the Digitalmars-d-learn mailing list